diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index a830d2b7..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[bumpversion] -current_version = 0.1.5 -commit = True -tag = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-(?P[^.]*)\.(?P\d+))? -serialize = - {major}.{minor}.{patch}-{stage}.{devnum} - {major}.{minor}.{patch} - -[bumpversion:part:stage] -optional_value = stable -first_value = stable -values = - alpha - beta - stable - -[bumpversion:part:devnum] - -[bumpversion:file:setup.py] -search = version="{current_version}", -replace = version="{new_version}", diff --git a/.circleci/config.yml b/.circleci/config.yml index b5a0d13c..fe587778 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,14 +86,32 @@ windows-wheel-steps: key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} docs: &docs - docker: - - image: common + working_directory: ~/repo steps: + - checkout + - restore_cache: + keys: + - cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - run: + name: install dependencies + command: | + python -m pip install --upgrade pip + python -m pip install tox - run: name: install latexpdf dependencies command: | sudo apt-get update sudo apt-get install latexmk tex-gyre texlive-fonts-extra + - run: + name: run tox + command: python -m tox run -r + - save_cache: + paths: + - .tox + - ~/.cache/pip + - ~/.local + key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + resource_class: xlarge interop: &interop docker: @@ -103,7 +121,6 @@ interop: &interop name: install interop test dependencies command: | sudo apt-get update - sudo apt-get install latexmk tex-gyre texlive-fonts-extra wget https://dl.google.com/go/$GOBINPKG sudo tar -C /usr/local -xzf $GOBINPKG export GOPATH=$HOME/go @@ -115,7 +132,7 @@ jobs: docs: <<: *docs docker: - - image: cimg/python:3.8 + - image: cimg/python:3.9 environment: TOXENV: docs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 504c1a8d..f1668a93 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,3 +50,11 @@ repos: # additional_dependencies: # - mypy-protobuf # exclude: 'tests/|tests_interop/|crypto/|identity/|pubsub/|insecure/|noise/|security/' +- repo: local + hooks: + - id: check-rst-files + name: Check for .rst files in the top-level directory + entry: sh -c 'ls *.rst 1>/dev/null 2>&1 && { echo "found .rst file in top-level folder"; exit 1; } || exit 0' + language: system + always_run: true + pass_filenames: false diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e55e07e4..0af33bb9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py @@ -15,6 +15,7 @@ python: path: . extra_requirements: - docs + - test # Build all formats for RTD Downloads - htmlzip, pdf, epub formats: all diff --git a/MANIFEST.in b/MANIFEST.in index d4cc47d3..34c30460 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ include LICENSE-APACHE include LICENSE-MIT include README.md +recursive-include scripts * recursive-include tests * global-include *.pyi diff --git a/Makefile b/Makefile index 218c2861..836444fa 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign) help: @echo "clean-build - remove build artifacts" @echo "clean-pyc - remove Python file artifacts" + @echo "clean - run clean-build and clean-pyc" @echo "lint - fix linting issues with pre-commit" @echo "test - run tests quickly with the default Python" @echo "docs - generate docs and open in browser (linux-docs for version on linux)" @@ -12,29 +13,6 @@ help: @echo "release - package and upload a release (does not run notes target)" @echo "dist - package" -FILES_TO_LINT = libp2p tests tests_interop examples setup.py -PB = libp2p/crypto/pb/crypto.proto \ - libp2p/pubsub/pb/rpc.proto \ - libp2p/security/insecure/pb/plaintext.proto \ - libp2p/security/secio/pb/spipe.proto \ - libp2p/security/noise/pb/noise.proto \ - libp2p/identity/identify/pb/identify.proto -PY = $(PB:.proto=_pb2.py) -PYI = $(PB:.proto=_pb2.pyi) - -# Set default to `protobufs`, otherwise `format` is called when typing only `make` -all: protobufs - -protobufs: $(PY) - -%_pb2.py: %.proto - protoc --python_out=. --mypy_out=. $< - -clean-proto: - rm -f $(PY) $(PYI) - -clean: clean-build clean-pyc - clean-build: rm -fr build/ rm -fr dist/ @@ -45,6 +23,8 @@ clean-pyc: find . -name '*~' -exec rm -f {} + find . -name '__pycache__' -exec rm -rf {} + +clean: clean-build clean-pyc + lint: @pre-commit run --all-files --show-diff-on-failure || ( \ echo "\n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \ @@ -54,23 +34,29 @@ lint: test: pytest tests -build-docs: - sphinx-apidoc -o docs/ . setup.py "*conftest*" "libp2p/tools/interop*" - $(MAKE) -C docs clean - $(MAKE) -C docs html - $(MAKE) -C docs doctest +# protobufs management -build-docs-ci: - $(MAKE) -C docs latexpdf - $(MAKE) -C docs epub +PB = libp2p/crypto/pb/crypto.proto \ + libp2p/pubsub/pb/rpc.proto \ + libp2p/security/insecure/pb/plaintext.proto \ + libp2p/security/secio/pb/spipe.proto \ + libp2p/security/noise/pb/noise.proto \ + libp2p/identity/identify/pb/identify.proto +PY = $(PB:.proto=_pb2.py) +PYI = $(PB:.proto=_pb2.pyi) -validate-newsfragments: - python ./newsfragments/validate_files.py - towncrier build --draft --version preview +## Set default to `protobufs`, otherwise `format` is called when typing only `make` +all: protobufs -check-docs: build-docs validate-newsfragments +protobufs: $(PY) -check-docs-ci: build-docs build-docs-ci validate-newsfragments +%_pb2.py: %.proto + protoc --python_out=. --mypy_out=. $< + +clean-proto: + rm -f $(PY) $(PYI) + +# docs commands docs: check-docs open docs/_build/html/index.html @@ -78,19 +64,37 @@ docs: check-docs linux-docs: check-docs xdg-open docs/_build/html/index.html -package: clean - python setup.py sdist bdist_wheel +# docs helpers + +validate-newsfragments: + python ./newsfragments/validate_files.py + towncrier build --draft --version preview + +check-docs: build-docs validate-newsfragments + +build-docs: + sphinx-apidoc -o docs/ . setup.py "*conftest*" "libp2p/tools/interop*" + $(MAKE) -C docs clean + $(MAKE) -C docs html + $(MAKE) -C docs doctest + +# docs helpers for CI, which requires extra dependencies + +check-docs-ci: build-docs build-docs-ci validate-newsfragments + +build-docs-ci: + $(MAKE) -C docs latexpdf + $(MAKE) -C docs epub + +# release commands + +package-test: clean + python -m build python scripts/release/test_package.py -notes: -check-bump: -ifndef bump - $(error bump must be set, typically: major, minor, patch, or devnum) -endif - -notes: check-bump +notes: check-bump validate-newsfragments # Let UPCOMING_VERSION be the version that is used for the current bump - $(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g')) + $(eval UPCOMING_VERSION=$(shell bump-my-version show --increment $(bump) new_version)) # Now generate the release notes to have them included in the release commit towncrier build --yes --version $(UPCOMING_VERSION) # Before we bump the version, make sure that the towncrier-generated docs will build @@ -98,20 +102,31 @@ notes: check-bump git commit -m "Compile release notes for v$(UPCOMING_VERSION)" release: check-bump clean - # require that upstream is configured for ethereum/py-libp2p - @git remote -v | grep -E "upstream\tgit@github.com:ethereum/py-libp2p.git \(push\)|upstream\thttps://(www.)?github.com/ethereum/py-libp2p \(push\)" - # verify that docs build correctly + # verify that notes command ran correctly ./newsfragments/validate_files.py is-empty - make build-docs CURRENT_SIGN_SETTING=$(git config commit.gpgSign) git config commit.gpgSign true - bumpversion $(bump) - git push upstream && git push upstream --tags + bump-my-version bump $(bump) python -m build - twine upload dist/* git config commit.gpgSign "$(CURRENT_SIGN_SETTING)" + git push upstream && git push upstream --tags + twine upload dist/* +# release helpers -dist: clean - python -m build - ls -l dist +check-bump: +ifndef bump + $(error bump must be one of: major, minor, patch, stage, or devnum) +endif + +check-git: + # require that you be on a branch that's linked to upstream/main + @if ! git status -s -b | head -1 | grep -q "\.\.upstream/main"; then \ + echo "Error: You must be on a branch that's linked to upstream/main"; \ + exit 1; \ + fi + # require that upstream is configured for ethereum/py-libp2p + @if ! git remote -v | grep "upstream[[:space:]]git@github.com:ethereum/py-libp2p.git (push)\|upstream[[:space:]]https://github.com/ethereum/py-libp2p (push)"; then \ + echo "Error: You must have a remote named 'upstream' that points to 'py-libp2p'"; \ + exit 1; \ + fi diff --git a/README.md b/README.md index f4f4b98d..3856eb92 100644 --- a/README.md +++ b/README.md @@ -26,28 +26,7 @@ Read more in the [documentation on ReadTheDocs](https://py-libp2p.readthedocs.io Currently maintained by [@pacrob](https://github.com/pacrob) and [@dhuseby](https://github.com/dhuseby), looking for assistance! -Note that tests/test_libp2p/test_libp2p.py contains an end-to-end messaging test between two libp2p hosts, which is the bulk of our proof of concept. - -### Dependencies - -On Debian Linux you will need to ensure that you have the [GNU Multiprecision Arithmetic Library](https://gmplib.org/) installed since it is a dependency of the fastecdsa package. You can install it using the following command: - -```sh -sudo apt-get install libgmp-dev -``` - -### Testing - -Running `pytest` doesn't work with this project. The correct way to execute tests is to run `make test`. - -### Release setup - -Releases follow the same basic pattern as releases of some tangentially-related projects, -like Trinity. See [Trinity's release instructions](https://trinity-client.readthedocs.io/en/latest/contributing.html#releasing). - -## Requirements - -The protobuf description in this repository was generated by `protoc` at version `25.3`. +Note that tests/core/test_libp2p/test_libp2p.py contains an end-to-end messaging test between two libp2p hosts, which is the bulk of our proof of concept. ## Feature Breakdown diff --git a/docs/conf.py b/docs/conf.py index a8467702..ed2cab6a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -118,7 +118,10 @@ html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = { + "logo_only": True, + "display_version": False, +} # Add any paths that contain custom themes here, relative to this directory. @@ -131,7 +134,7 @@ html_theme = "sphinx_rtd_theme" # The name of an image file (relative to this directory) to place at the top # of the sidebar. -# html_logo = None +html_logo = "docs/_static/libp2p_logo.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -141,7 +144,7 @@ html_theme = "sphinx_rtd_theme" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] +html_static_path = ["_static"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/docs/contributing.rst b/docs/contributing.rst index 4d975046..2b21167d 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -1,51 +1,152 @@ Contributing -============ +------------ Development ------------ - -py-libp2p requires Python 3.8+. +~~~~~~~~~~~ To get started, fork the repository to your own github account, then clone it to your development machine: -```sh -git clone git@github.com:/py-libp2p.git -``` +.. code:: sh + + git clone git@github.com:your-github-username/py-libp2p.git + then install the development dependencies. We recommend using a virtual environment, -such as [`virtualenv`](https://virtualenv.pypa.io/en/stable/) +such as `virtualenv `_. -```sh -cd py-libp2p -virtualenv -p python venv -. venv/bin/activate -python -m pip install -e ".[dev]" -pre-commit install -``` +.. code:: sh -We use [pre-commit](https://pre-commit.com/) to maintain consistent code style. Once -installed, it will run automatically with every commit. You can also run it manually -with `make lint`. If you need to make a commit that skips the `pre-commit` checks, you -can do so with `git commit --no-verify`. + cd py-libp2p + virtualenv -p python venv + . venv/bin/activate + python -m pip install -e ".[dev]" + pre-commit install + + +Dependencies +^^^^^^^^^^^^ + +On Debian Linux you will need to ensure that you have the +`GNU Multiprecision Arithmetic Library `_ +installed since it is a dependency of the fastecdsa package. You can install it using +the following command: + +.. code:: sh + + sudo apt-get install libgmp-dev + + +Requirements +^^^^^^^^^^^^ + +The protobuf description in this repository was generated by ``protoc`` at version +``25.3``. Testing -------- +~~~~~~~ -You can run the tests with `make test` or `pytest tests`. This will run the unit tests +Running that tests is a great way to explore the codebase. + +You can run all the tests with ``pytest tests``. + +At this time, the interop tests are not passing. You can run just the internal tests +with ``pytest tests/core``. +Code Style +~~~~~~~~~~ + +We use `pre-commit `_ to maintain consistent code style. Once +installed, it will run automatically with every commit. You can also run it manually +with: + +.. code:: sh + + make lint + +If you need to make a commit that skips the pre-commit checks, you can do so with +``git commit --no-verify``. + +This project uses ``mypy`` for static type checking, though it is not yet complete. +All new code should be fully typed, and we are working to add types to the existing +codebase. + +Releasing +~~~~~~~~~ + +Releases are typically done from the ``main`` branch, except when releasing a beta (in +which case the beta is released from ``main``, and the previous stable branch is +released from said branch). + +Final test before each release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before releasing a new version, build and test the package that will be released: + +.. code:: sh + + git checkout main && git pull + + make package-test -History -------- +This will build the package and install it in a temporary virtual environment. Follow +the instructions to activate the venv and test whatever you think is important. -Prior to 2023, this project is graciously sponsored by the Ethereum Foundation through -[Wave 5 of their Grants Program](https://blog.ethereum.org/2019/02/21/ethereum-foundation-grants-program-wave-5/). +You can also preview the release notes: -The creators and original maintainers of this project are: -* [@zixuanzh](https://github.com/zixuanzh) -* [@alexh](https://github.com/alexh) -* [@stuckinaboot](https://github.com/stuckinaboot) -* [@robzajac](https://github.com/robzajac) -* [@carver](https://github.com/carver) +.. code:: sh + + towncrier --draft + + +Build the release notes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before bumping the version number, build the release notes. You must include the part of +the version to bump (see below), which changes how the version number will show in the +release notes. + +.. code:: sh + + make notes bump=$$VERSION_PART_TO_BUMP$$ + + +If there are any errors, be sure to re-run make notes until it works. + +Push the release to github & pypi +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +After confirming that the release package looks okay, release a new version: + +.. code:: sh + + make release bump=$$VERSION_PART_TO_BUMP$$ + + +This command will: + +- Bump the version number as specified in ``.pyproject.toml`` and ``setup.py``. +- Create a git commit and tag for the new version. +- Build the package. +- Push the commit and tag to github. +- Push the new package files to pypi. + +Which version part to bump +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``$$VERSION_PART_TO_BUMP$$`` must be one of: ``major``, ``minor``, ``patch``, ``stage``, +or ``devnum``. + +The version format for this repo is ``{major}.{minor}.{patch}`` for stable, and +``{major}.{minor}.{patch}-{stage}.{devnum}`` for unstable (``stage`` can be alpha or +beta). + +If you are in a beta version, ``make release bump=stage`` will switch to a stable. + +To issue an unstable version when the current version is stable, specify the new version +explicitly, like ``make release bump="--new-version 4.0.0-alpha.1"`` + +You can see what the result of bumping any particular version part would be with +``bump-my-version show-bump`` diff --git a/docs/history.rst b/docs/history.rst new file mode 100644 index 00000000..cc127038 --- /dev/null +++ b/docs/history.rst @@ -0,0 +1,13 @@ +History +------- + +Prior to 2023, this project was graciously sponsored by the Ethereum Foundation through +`Wave 5 of their Grants Program `_. + +The creators and original maintainers of this project are: + +- `@zixuanzh `_ +- `@alexh `_ +- `@stuckinaboot `_ +- `@robzajac `_ +- `@carver `_ diff --git a/docs/index.rst b/docs/index.rst index 57154cbb..392e435b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,4 +27,5 @@ Contents :caption: Community contributing + history code_of_conduct diff --git a/newsfragments/454.docs.rst b/newsfragments/454.docs.rst new file mode 100644 index 00000000..3696e63d --- /dev/null +++ b/newsfragments/454.docs.rst @@ -0,0 +1 @@ +Move contributing and history info from README to docs diff --git a/newsfragments/454.internal.rst b/newsfragments/454.internal.rst new file mode 100644 index 00000000..ee12a074 --- /dev/null +++ b/newsfragments/454.internal.rst @@ -0,0 +1 @@ +Fix docs CI, drop ``bumpversion`` for ``bump-my-version``, reorg tests diff --git a/pyproject.toml b/pyproject.toml index 9bbbec80..b485dab7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,36 +1,35 @@ [tool.autoflake] -remove_all_unused_imports = true exclude = "__init__.py" +remove_all_unused_imports = true [tool.isort] combine_as_imports = false extra_standard_library = "pytest" force_grid_wrap = 1 force_sort_within_sections = true -known_third_party = "anyio,factory,lru,p2pclient,pytest,noise" known_first_party = "libp2p" +known_third_party = "anyio,factory,lru,p2pclient,pytest,noise" multi_line_output = 3 profile = "black" skip_glob= "*_pb2*.py, *.pyi" [tool.mypy] check_untyped_defs = true -disallow_incomplete_defs = true -disallow_untyped_defs = true disallow_any_generics = true +disallow_incomplete_defs = true +disallow_subclassing_any = false disallow_untyped_calls = true disallow_untyped_decorators = true -disallow_subclassing_any = false +disallow_untyped_defs = true ignore_missing_imports = true incremental = false -strict_optional = false strict_equality = true +strict_optional = false warn_redundant_casts = true warn_return_any = false warn_unused_configs = true warn_unused_ignores = true - [tool.pydocstyle] # All error codes found here: # http://www.pydocstyle.org/en/3.0.0/error_codes.html @@ -65,22 +64,19 @@ add-ignore = "D200,D203,D204,D205,D212,D302,D400,D401,D412,D415" [tool.pytest.ini_options] addopts = "-v --showlocals --durations 50 --maxfail 10" -xfail_strict = true -log_format = "%(levelname)8s %(asctime)s %(filename)20s %(message)s" log_date_format = "%m-%d %H:%M:%S" - -markers = [ - "slow: mark test as slow", -] +log_format = "%(levelname)8s %(asctime)s %(filename)20s %(message)s" +markers = ["slow: mark test as slow"] +xfail_strict = true [tool.towncrier] # Read https://github.com/ethereum/py-libp2p/blob/main/newsfragments/README.md for instructions -package = "libp2p" -filename = "docs/release_notes.rst" directory = "newsfragments" -underlines = ["-", "~", "^"] -title_format = "py-libp2p v{version} ({project_date})" +filename = "docs/release_notes.rst" issue_format = "`#{issue} `__" +package = "libp2p" +title_format = "py-libp2p v{version} ({project_date})" +underlines = ["-", "~", "^"] [[tool.towncrier.type]] directory = "breaking" @@ -126,3 +122,46 @@ showcontent = true directory = "removal" name = "Removals" showcontent = true + +[tool.bumpversion] +current_version = "0.1.5" +parse = """ + (?P\\d+) + \\.(?P\\d+) + \\.(?P\\d+) + (- + (?P[^.]*) + \\.(?P\\d+) + )? +""" +serialize = [ + "{major}.{minor}.{patch}-{stage}.{devnum}", + "{major}.{minor}.{patch}", +] +search = "{current_version}" +replace = "{new_version}" +regex = false +ignore_missing_version = false +tag = true +sign_tags = true +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" + +[tool.bumpversion.parts.stage] +optional_value = "stable" +first_value = "stable" +values = [ + "alpha", + "beta", + "stable", +] + +[tool.bumpversion.part.devnum] + +[[tool.bumpversion.files]] +filename = "setup.py" +search = "version=\"{current_version}\"" +replace = "version=\"{new_version}\"" diff --git a/setup.py b/setup.py index aed39a65..f1e31729 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from setuptools import ( extras_require = { "dev": [ "build>=0.9.0", - "bumpversion>=0.5.3", + "bump-my-version>=0.5.3", "ipython", "pre-commit>=3.4.0", "tox>=4.0.0", @@ -98,7 +98,7 @@ setup( license="MIT/APACHE2.0", zip_safe=False, keywords="libp2p p2p", - packages=find_packages(exclude=["tests", "tests.*"]), + packages=find_packages(exclude=["scripts", "scripts.*", "tests", "tests.*"]), package_data={"libp2p": ["py.typed"]}, classifiers=[ "Development Status :: 4 - Beta", diff --git a/tests/crypto/test_ed25519.py b/tests/core/crypto/test_ed25519.py similarity index 100% rename from tests/crypto/test_ed25519.py rename to tests/core/crypto/test_ed25519.py diff --git a/tests/crypto/test_secp256k1.py b/tests/core/crypto/test_secp256k1.py similarity index 100% rename from tests/crypto/test_secp256k1.py rename to tests/core/crypto/test_secp256k1.py diff --git a/tests/examples/test_examples.py b/tests/core/examples/test_examples.py similarity index 100% rename from tests/examples/test_examples.py rename to tests/core/examples/test_examples.py diff --git a/tests/host/test_basic_host.py b/tests/core/host/test_basic_host.py similarity index 100% rename from tests/host/test_basic_host.py rename to tests/core/host/test_basic_host.py diff --git a/tests/host/test_ping.py b/tests/core/host/test_ping.py similarity index 100% rename from tests/host/test_ping.py rename to tests/core/host/test_ping.py diff --git a/tests/host/test_routed_host.py b/tests/core/host/test_routed_host.py similarity index 100% rename from tests/host/test_routed_host.py rename to tests/core/host/test_routed_host.py diff --git a/tests/identity/identify/test_protocol.py b/tests/core/identity/identify/test_protocol.py similarity index 100% rename from tests/identity/identify/test_protocol.py rename to tests/core/identity/identify/test_protocol.py diff --git a/tests/network/conftest.py b/tests/core/network/conftest.py similarity index 100% rename from tests/network/conftest.py rename to tests/core/network/conftest.py diff --git a/tests/network/test_net_stream.py b/tests/core/network/test_net_stream.py similarity index 100% rename from tests/network/test_net_stream.py rename to tests/core/network/test_net_stream.py diff --git a/tests/network/test_notify.py b/tests/core/network/test_notify.py similarity index 100% rename from tests/network/test_notify.py rename to tests/core/network/test_notify.py diff --git a/tests/network/test_swarm.py b/tests/core/network/test_swarm.py similarity index 100% rename from tests/network/test_swarm.py rename to tests/core/network/test_swarm.py diff --git a/tests/network/test_swarm_conn.py b/tests/core/network/test_swarm_conn.py similarity index 100% rename from tests/network/test_swarm_conn.py rename to tests/core/network/test_swarm_conn.py diff --git a/tests/peer/test_addrbook.py b/tests/core/peer/test_addrbook.py similarity index 100% rename from tests/peer/test_addrbook.py rename to tests/core/peer/test_addrbook.py diff --git a/tests/peer/test_interop.py b/tests/core/peer/test_interop.py similarity index 100% rename from tests/peer/test_interop.py rename to tests/core/peer/test_interop.py diff --git a/tests/peer/test_peerid.py b/tests/core/peer/test_peerid.py similarity index 100% rename from tests/peer/test_peerid.py rename to tests/core/peer/test_peerid.py diff --git a/tests/peer/test_peerinfo.py b/tests/core/peer/test_peerinfo.py similarity index 100% rename from tests/peer/test_peerinfo.py rename to tests/core/peer/test_peerinfo.py diff --git a/tests/peer/test_peermetadata.py b/tests/core/peer/test_peermetadata.py similarity index 100% rename from tests/peer/test_peermetadata.py rename to tests/core/peer/test_peermetadata.py diff --git a/tests/peer/test_peerstore.py b/tests/core/peer/test_peerstore.py similarity index 100% rename from tests/peer/test_peerstore.py rename to tests/core/peer/test_peerstore.py diff --git a/tests/protocol_muxer/test_protocol_muxer.py b/tests/core/protocol_muxer/test_protocol_muxer.py similarity index 100% rename from tests/protocol_muxer/test_protocol_muxer.py rename to tests/core/protocol_muxer/test_protocol_muxer.py diff --git a/tests/pubsub/test_dummyaccount_demo.py b/tests/core/pubsub/test_dummyaccount_demo.py similarity index 100% rename from tests/pubsub/test_dummyaccount_demo.py rename to tests/core/pubsub/test_dummyaccount_demo.py diff --git a/tests/pubsub/test_floodsub.py b/tests/core/pubsub/test_floodsub.py similarity index 100% rename from tests/pubsub/test_floodsub.py rename to tests/core/pubsub/test_floodsub.py diff --git a/tests/pubsub/test_gossipsub.py b/tests/core/pubsub/test_gossipsub.py similarity index 100% rename from tests/pubsub/test_gossipsub.py rename to tests/core/pubsub/test_gossipsub.py diff --git a/tests/pubsub/test_gossipsub_backward_compatibility.py b/tests/core/pubsub/test_gossipsub_backward_compatibility.py similarity index 100% rename from tests/pubsub/test_gossipsub_backward_compatibility.py rename to tests/core/pubsub/test_gossipsub_backward_compatibility.py diff --git a/tests/pubsub/test_mcache.py b/tests/core/pubsub/test_mcache.py similarity index 100% rename from tests/pubsub/test_mcache.py rename to tests/core/pubsub/test_mcache.py diff --git a/tests/pubsub/test_pubsub.py b/tests/core/pubsub/test_pubsub.py similarity index 100% rename from tests/pubsub/test_pubsub.py rename to tests/core/pubsub/test_pubsub.py diff --git a/tests/pubsub/test_subscription.py b/tests/core/pubsub/test_subscription.py similarity index 100% rename from tests/pubsub/test_subscription.py rename to tests/core/pubsub/test_subscription.py diff --git a/tests/security/noise/test_msg_read_writer.py b/tests/core/security/noise/test_msg_read_writer.py similarity index 100% rename from tests/security/noise/test_msg_read_writer.py rename to tests/core/security/noise/test_msg_read_writer.py diff --git a/tests/security/noise/test_noise.py b/tests/core/security/noise/test_noise.py similarity index 100% rename from tests/security/noise/test_noise.py rename to tests/core/security/noise/test_noise.py diff --git a/tests/security/test_secio.py b/tests/core/security/test_secio.py similarity index 100% rename from tests/security/test_secio.py rename to tests/core/security/test_secio.py diff --git a/tests/security/test_security_multistream.py b/tests/core/security/test_security_multistream.py similarity index 100% rename from tests/security/test_security_multistream.py rename to tests/core/security/test_security_multistream.py diff --git a/tests/stream_muxer/conftest.py b/tests/core/stream_muxer/conftest.py similarity index 100% rename from tests/stream_muxer/conftest.py rename to tests/core/stream_muxer/conftest.py diff --git a/tests/stream_muxer/test_mplex_conn.py b/tests/core/stream_muxer/test_mplex_conn.py similarity index 100% rename from tests/stream_muxer/test_mplex_conn.py rename to tests/core/stream_muxer/test_mplex_conn.py diff --git a/tests/stream_muxer/test_mplex_stream.py b/tests/core/stream_muxer/test_mplex_stream.py similarity index 100% rename from tests/stream_muxer/test_mplex_stream.py rename to tests/core/stream_muxer/test_mplex_stream.py diff --git a/tests/test_libp2p/test_libp2p.py b/tests/core/test_libp2p/test_libp2p.py similarity index 100% rename from tests/test_libp2p/test_libp2p.py rename to tests/core/test_libp2p/test_libp2p.py diff --git a/tests/transport/test_tcp.py b/tests/core/transport/test_tcp.py similarity index 100% rename from tests/transport/test_tcp.py rename to tests/core/transport/test_tcp.py diff --git a/tests_interop/conftest.py b/tests/interop/conftest.py similarity index 100% rename from tests_interop/conftest.py rename to tests/interop/conftest.py diff --git a/tests_interop/go_pkgs/examples/README.md b/tests/interop/go_pkgs/examples/README.md similarity index 100% rename from tests_interop/go_pkgs/examples/README.md rename to tests/interop/go_pkgs/examples/README.md diff --git a/tests_interop/go_pkgs/examples/echo/main.go b/tests/interop/go_pkgs/examples/echo/main.go similarity index 100% rename from tests_interop/go_pkgs/examples/echo/main.go rename to tests/interop/go_pkgs/examples/echo/main.go diff --git a/tests_interop/go_pkgs/examples/go.mod b/tests/interop/go_pkgs/examples/go.mod similarity index 100% rename from tests_interop/go_pkgs/examples/go.mod rename to tests/interop/go_pkgs/examples/go.mod diff --git a/tests_interop/go_pkgs/examples/go.sum b/tests/interop/go_pkgs/examples/go.sum similarity index 100% rename from tests_interop/go_pkgs/examples/go.sum rename to tests/interop/go_pkgs/examples/go.sum diff --git a/tests_interop/go_pkgs/examples/utils/host.go b/tests/interop/go_pkgs/examples/utils/host.go similarity index 100% rename from tests_interop/go_pkgs/examples/utils/host.go rename to tests/interop/go_pkgs/examples/utils/host.go diff --git a/tests_interop/go_pkgs/install_interop_go_pkgs.sh b/tests/interop/go_pkgs/install_interop_go_pkgs.sh similarity index 100% rename from tests_interop/go_pkgs/install_interop_go_pkgs.sh rename to tests/interop/go_pkgs/install_interop_go_pkgs.sh diff --git a/tests_interop/test_bindings.py b/tests/interop/test_bindings.py similarity index 100% rename from tests_interop/test_bindings.py rename to tests/interop/test_bindings.py diff --git a/tests_interop/test_echo.py b/tests/interop/test_echo.py similarity index 100% rename from tests_interop/test_echo.py rename to tests/interop/test_echo.py diff --git a/tests_interop/test_net_stream.py b/tests/interop/test_net_stream.py similarity index 100% rename from tests_interop/test_net_stream.py rename to tests/interop/test_net_stream.py diff --git a/tests_interop/test_pubsub.py b/tests/interop/test_pubsub.py similarity index 100% rename from tests_interop/test_pubsub.py rename to tests/interop/test_pubsub.py diff --git a/tox.ini b/tox.ini index 401cbff4..8fcb5e3d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,9 +3,9 @@ envlist= py{38,39,310,311,312}-core py{38,39,310,311,312}-lint py{38,39,310,311,312}-wheel + py{38,39,310,311,312}-interop windows-wheel docs - py{38,39,310,311,312}-interop [flake8] exclude=venv*,.tox,docs,build,*_pb2*.py @@ -16,7 +16,8 @@ per-file-ignores=__init__.py:F401 [testenv] usedevelop=True commands= - core: pytest {posargs:tests/} + core: pytest {posargs:tests/core} + interop: pytest {posargs:tests/interop} docs: make check-docs-ci basepython= docs: python