Skip to content

Commit

Permalink
Merge branch 'nats-io:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tdgroot authored Jan 10, 2025
2 parents ed10806 + 7e7883e commit 4a00ff4
Show file tree
Hide file tree
Showing 73 changed files with 5,662 additions and 1,848 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
format:
runs-on: ubuntu-latest
name: Format
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev
- name: Run format check
run: |
pipenv run yapf --diff --recursive .
- name: Run isort check
run: pipenv run isort --check-only --diff .
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test

on:
push:
branches:
- main
pull_request:
branches:
- "**"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev
bash ./scripts/install_nats.sh
- name: Run tests
run: |
pipenv run flake8 --ignore="W391, W503, W504" ./nats/js/
pipenv run pytest -x -vv -s --continue-on-collection-errors
env:
PATH: $HOME/nats-server:$PATH
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
combine_as_imports = true
multi_line_output = 3
include_trailing_comma = true
src_paths = ["nats", "tests"]
36 changes: 11 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dist: jammy

jobs:
include:
- name: "Python: 3.12"
python: "3.12-dev"
- name: "Python: 3.13"
python: "3.13"
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
- sudo apt-get install python3-pip
Expand All @@ -39,8 +39,8 @@ jobs:
- bash ./scripts/install_nats.sh
install:
- pip install -e .[fast-mail-parser]
- name: "Python: 3.11"
python: "3.11"
- name: "Python: 3.12"
python: "3.12"
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
- sudo apt-get install python3-pip
Expand All @@ -49,7 +49,7 @@ jobs:
- bash ./scripts/install_nats.sh
install:
- pip install -e .[fast-mail-parser]
- name: "Python: 3.11/uvloop"
- name: "Python: 3.11"
python: "3.11"
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
Expand All @@ -59,11 +59,8 @@ jobs:
- bash ./scripts/install_nats.sh
install:
- pip install -e .[fast-mail-parser]
- pip install uvloop
- name: "Python: 3.11 (nats-server@main)"
- name: "Python: 3.11/uvloop"
python: "3.11"
env:
- NATS_SERVER_VERSION=main
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
- sudo apt-get install python3-pip
Expand All @@ -72,10 +69,11 @@ jobs:
- bash ./scripts/install_nats.sh
install:
- pip install -e .[fast-mail-parser]
- name: "Python: 3.11 (nats-server@dev)"
- pip install uvloop
- name: "Python: 3.11 (nats-server@main)"
python: "3.11"
env:
- NATS_SERVER_VERSION=dev
- NATS_SERVER_VERSION=main
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
- sudo apt-get install python3-pip
Expand All @@ -84,22 +82,10 @@ jobs:
- bash ./scripts/install_nats.sh
install:
- pip install -e .[fast-mail-parser]
- name: "Python: 3.7"
python: "3.7"
before_install:
- sudo apt update && sudo apt install gcc build-essential -y
- sudo apt-get install python3-pip
- sudo apt-get install python3-pytest
- pip install --upgrade pip
- bash ./scripts/install_nats.sh
install:
- pip install -e .[aiohttp,fast-mail-parser]
script:
- pytest -vv -s --continue-on-collection-errors tests
allow_failures:
- name: "Python: 3.7"
- name: "Python: 3.8"
- name: "Python: 3.11"
- name: "Python: 3.11/uvloop"
- name: "Python: 3.11 (nats-server@dev)"
- name: "Python: 3.11 (nats-server@main)"
- name: "Python: 3.12"
- name: "Python: 3.13"
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing

Thanks for your interest in contributing! This document contains `nats-io/nats.py` specific contributing details. If you are a first-time contributor, please refer to the general [NATS Contributor Guide](https://nats.io/contributing/) to get a comprehensive overview of contributing to the NATS project.

## Getting started

There are three general ways you can contribute to this repo:

- Proposing an enhancement or new feature
- Reporting a bug or regression
- Contributing changes to the source code

For the first two, refer to the [GitHub Issues](https://github.com/nats-io/nats.py/issues/new/choose) which guides you through the available options along with the needed information to collect.

## Contributing changes

_Prior to opening a pull request, it is recommended to open an issue first to ensure the maintainers can review intended changes. Exceptions to this rule include fixing non-functional source such as code comments, documentation or other supporting files._

Proposing source code changes is done through GitHub's standard pull request workflow.

If your branch is a work-in-progress then please start by creating your pull requests as draft, by clicking the down-arrow next to the `Create pull request` button and instead selecting `Create draft pull request`.

This will defer the automatic process of requesting a review from the NATS team and significantly reduces noise until you are ready. Once you are happy, you can click the `Ready for review` button.

### Guidelines

A good pull request includes:

- A high-level description of the changes, including links to any issues that are related by adding comments like `Resolves #NNN` to your description. See [Linking a Pull Request to an Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) for more information.
- An up-to-date parent commit. Please make sure you are pulling in the latest `main` branch and rebasing your work on top of it, i.e. `git rebase main`.
- Unit tests where appropriate. Bug fixes will benefit from the addition of regression tests. New features will not be accepted without suitable test coverage!
- No more commits than necessary. Sometimes having multiple commits is useful for telling a story or isolating changes from one another, but please squash down any unnecessary commits that may just be for clean-up, comments or small changes.
- No additional external dependencies that aren't absolutely essential. Please do everything you can to avoid pulling in additional libraries/dependencies into `go.mod` as we will be very critical of these.

### Sign-off

In order to accept a contribution, you will first need to certify that the contribution is your original work and that you license the work to the project under the [Apache-2.0 license](https://github.com/nats-io/nats.py/blob/main/LICENSE).

This is done by using `Signed-off-by` statements, which should appear in **both** your commit messages and your PR description. Please note that we can only accept sign-offs under a legal name. Nicknames and aliases are not permitted.

To perform a sign-off with `git`, use `git commit -s` (or `--signoff`).

## Get help

If you have questions about the contribution process, please start a [GitHub discussion](https://github.com/nats-io/nats.py/discussions), join the [NATS Slack](https://slack.nats.io/), or send your question to the [NATS Google Group](https://groups.google.com/forum/#!forum/natsio).
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ci: deps
# pipenv run yapf --recursive --diff $(SOURCE_CODE)
# pipenv run yapf --recursive --diff tests
# pipenv run mypy
pipenv run flake8 --ignore=W391 ./nats/js/
pipenv run flake8 --ignore="W391, W503, W504" ./nats/js/
pipenv run pytest -x -vv -s --continue-on-collection-errors

watch:
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pytest-cov = "*"
yapf = "*"
toml = "*" # see https://github.com/google/yapf/issues/936
exceptiongroup = "*"
isort = "*"
Loading

0 comments on commit 4a00ff4

Please sign in to comment.