From 32b7ddcf6d243a76d282499d3bf1da39cfaedc53 Mon Sep 17 00:00:00 2001 From: Rodrigo Martins Higuti de Oliveira Date: Fri, 12 Jul 2024 18:01:12 -0300 Subject: [PATCH] Switch to Flit for package publishing --- .bumpversion.cfg | 14 -- .coveragerc | 14 -- .github/workflows/release.yml | 49 +++++-- .sonarcloud.properties | 3 - Makefile | 13 +- docs/_modules/index.html | 2 +- .../autowiring/autowired_decorator.html | 2 +- .../injectable/autowiring/autowired_type.html | 2 +- .../container/injection_container.html | 30 ++--- .../container/load_injection_container.html | 30 ++--- .../injectable/errors/injection_error.html | 2 +- .../_modules/injectable/injection/inject.html | 2 +- .../injection/injectable_decorator.html | 30 ++--- .../injectable_factory_decorator.html | 30 ++--- .../testing/clear_injectables_util.html | 30 ++--- .../testing/register_injectables_util.html | 30 ++--- .../reset_injection_container_util.html | 30 ++--- docs/authors.html | 2 +- docs/caveats.html | 2 +- docs/changelog.html | 6 +- docs/contributing.html | 2 +- docs/index.html | 4 +- docs/installation.html | 2 +- docs/py-modindex.html | 2 +- docs/readme.html | 4 +- docs/reference/index.html | 2 +- docs/reference/injectable.html | 2 +- docs/reference/injectable_constants.html | 2 +- docs/reference/injectable_errors.html | 2 +- docs/reference/injectable_testing.html | 2 +- docs/usage/TLDR.html | 2 +- docs/usage/annotated_usage.html | 2 +- docs/usage/basic_usage.html | 2 +- docs/usage/cyclic_dependency.html | 2 +- docs/usage/dependencies_precedence.html | 5 +- docs/usage/factory.html | 2 +- docs/usage/index.html | 2 +- docs/usage/injectable_mocking_for_tests.html | 2 +- docs/usage/injecting_existing_instance.html | 2 +- ...jection_container_resetting_for_tests.html | 2 +- docs/usage/lazy_injection.html | 2 +- docs/usage/namespaces.html | 2 +- docs/usage/optional_injection.html | 2 +- docs/usage/qualifier_overloading.html | 5 +- docs/usage/service_locator.html | 2 +- docs/usage/singletons.html | 2 +- injectable/__init__.py | 2 + pyproject.toml | 121 ++++++++++++++++++ requirements.dev.txt | 12 -- requirements.txt | 5 - setup.cfg | 6 +- setup.py | 78 ----------- 52 files changed, 319 insertions(+), 290 deletions(-) delete mode 100644 .bumpversion.cfg delete mode 100644 .coveragerc delete mode 100644 .sonarcloud.properties create mode 100644 pyproject.toml delete mode 100644 requirements.dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 6f31908..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[bumpversion] -current_version = 4.0.0 - -[bumpversion:file:Makefile] -search = CURRENT_VERSION = {current_version} -replace = CURRENT_VERSION = {new_version} - -[bumpversion:file:setup.py] -search = version="{current_version}" -replace = version="{new_version}" - -[bumpversion:file:docs/conf.py] -search = version = release = "{current_version}" -replace = version = release = "{new_version}" diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 9e3de3e..0000000 --- a/.coveragerc +++ /dev/null @@ -1,14 +0,0 @@ -[paths] -source = injectable - -[run] -branch = true -source = - injectable - tests -parallel = true - -[report] -show_missing = true -precision = 2 -omit = *migrations* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 370a738..822cf24 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,20 +1,53 @@ -name: release +name: Upload Python Package on: release: - types: published + types: [published] + +permissions: + contents: read jobs: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Build release distributions + run: | + python -m pip install build + python -m build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + pypi-publish: - name: Upload release to PyPI runs-on: ubuntu-latest + + needs: + - release-build + + permissions: + id-token: write + environment: name: pypi url: https://pypi.org/p/injectable - permissions: - id-token: write + steps: - - id: checkout_action - uses: actions/checkout@master - - name: Publish package distributions to PyPI + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI uses: pypa/gh-action-pypi-publish@v1.9.0 diff --git a/.sonarcloud.properties b/.sonarcloud.properties deleted file mode 100644 index 6f96d87..0000000 --- a/.sonarcloud.properties +++ /dev/null @@ -1,3 +0,0 @@ -sonar.sources=injectable -sonar.python.coverage.reportPath=coverage.xml -sonar.tests=./tests diff --git a/Makefile b/Makefile index b139702..143ef70 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ environment: ## create environment .PHONY: requirements requirements: ## install all requirements - pip install -Ur requirements.txt -Ur requirements.dev.txt + pip install ".[docs,test,build]" .PHONY: flake-check flake-check: ## check PEP-8 and other standards with flake8 @@ -37,25 +37,25 @@ black: ## apply the Black code style to code .PHONY: tests tests: ## run tests with pytest - python setup.py develop + pip install -e .[test] python -m pytest --cov=injectable --cov-report term --cov-report html:htmlcov \ --cov-report xml:coverage.xml tests .PHONY: unit-tests unit-tests: ## run unit tests with pytest - python setup.py develop + pip install -e .[test] python -m pytest --cov=injectable --cov-report term --cov-report \ html:tests/unit/htmlcov --cov-report xml:tests/unit/coverage.xml tests/unit .PHONY: fixes-tests fixes-tests: ## run fixes tests with pytest - python setup.py develop + pip install -e .[test] python -m pytest --cov=injectable --cov-report term --cov-report \ html:tests/fixes/htmlcov --cov-report xml:tests/fixes/coverage.xml tests/fixes .PHONY: examples-tests examples-tests: ## run examples tests with pytest - python setup.py develop + pip install -e .[test] python -m pytest --cov=injectable --cov-report term --cov-report \ html:tests/examples/htmlcov --cov-report xml:tests/examples/coverage.xml \ tests/examples @@ -65,7 +65,8 @@ checks: black-check flake-check ## perform code standards and style checks .PHONY: package package: - python setup.py sdist + pip install -e .[build] + flit build .PHONY: docs docs: diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 46b5f0d..2a8b015 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -108,7 +108,7 @@

Navigation

diff --git a/docs/_modules/injectable/autowiring/autowired_decorator.html b/docs/_modules/injectable/autowiring/autowired_decorator.html index 6534348..7bb70ad 100644 --- a/docs/_modules/injectable/autowiring/autowired_decorator.html +++ b/docs/_modules/injectable/autowiring/autowired_decorator.html @@ -209,7 +209,7 @@

Navigation

diff --git a/docs/_modules/injectable/autowiring/autowired_type.html b/docs/_modules/injectable/autowiring/autowired_type.html index 9ca4e93..d895a57 100644 --- a/docs/_modules/injectable/autowiring/autowired_type.html +++ b/docs/_modules/injectable/autowiring/autowired_type.html @@ -249,7 +249,7 @@

Navigation

diff --git a/docs/_modules/injectable/container/injection_container.html b/docs/_modules/injectable/container/injection_container.html index 5c25fd4..0bfd855 100644 --- a/docs/_modules/injectable/container/injection_container.html +++ b/docs/_modules/injectable/container/injection_container.html @@ -4,47 +4,47 @@ - injectable.container.injection_container — injectable 3.4.7 documentation + injectable.container.injection_container — injectable 4.0.0 documentation - + - + - + - - + + - +
Fork me on GitHub
- - + +
- +

Source code for injectable.container.injection_container

 import os
 import warnings
@@ -254,7 +254,7 @@ 

Source code for injectable.container.injection_container