diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51c8e0a..85ce5ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -U coveralls - pip install -r requirements.txt + pip install -e .[dev] - name: Run tests run: | coverage run --branch pedantic/tests/tests_main.py @@ -33,7 +33,7 @@ jobs: deploy: needs: test runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' # only on master + if: github.ref == 'refs/heads/master' environment: name: pypi-deployment steps: @@ -41,13 +41,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.12 # Specify the Python version you want to use for deployment + python-version: 3.12 + - name: Install Build Tools + run: | + pip install -U build twine - name: Set Twine Environment Variables run: | echo "TWINE_USERNAME=${{ secrets.PYPI_USERNAME }}" >> $GITHUB_ENV echo "TWINE_PASSWORD=${{ secrets.PYPI_PASSWORD }}" >> $GITHUB_ENV - name: Build and Upload to PyPI run: | - pip install -U setuptools twine wheel - python setup.py bdist_wheel - twine upload dist/*.whl # Uploads the wheel file to PyPI + python -m build + twine upload dist/* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c9b25c5..2f56ec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## Pedantic 2.2.0 +- migrated from `setup.py` to `pyproject.toml` + ## Pedantic 2.1.11 - improve `GenericMixin` such that it also find bound type variables in parent classes diff --git a/create_pdoc.bat b/create_pdoc.bat deleted file mode 100644 index e1a6ff0..0000000 --- a/create_pdoc.bat +++ /dev/null @@ -1,4 +0,0 @@ -pip install pdoc3 -pdoc3 --html --output-dir docs pedantic --force -"docs/pedantic/index.html" -pause \ No newline at end of file diff --git a/create_requirements.bat b/create_requirements.bat deleted file mode 100644 index 2ace6c0..0000000 --- a/create_requirements.bat +++ /dev/null @@ -1 +0,0 @@ -"venv3.7/scripts/pip.exe" freeze > requirements.txt \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8a830f3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pedantic" +version = "2.2.0" +description = "Some useful Python decorators for cleaner software development." +readme = "README.md" +requires-python = ">=3.11" +license = {text = "Apache-2.0 License"} +authors = [ + {name = "Willi Sontopski", email = "willi_sontopski@arcor.de"}, +] +maintainers = [ + {name = "Willi Sontopski", email = "willi_sontopski@arcor.de"}, +] +keywords = ["decorators", "tools", "helpers", "type-checking", "pedantic", "type annotations"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", +] + +[project.urls] +"Bug Tracker" = "https://github.com/LostInDarkMath/pedantic-python-decorators/issues" +"Documentation" = "https://lostindarkmath.github.io/pedantic-python-decorators/pedantic/" +"Source Code" = "https://github.com/LostInDarkMath/pedantic-python-decorators" + +[project.optional-dependencies] +dev = [ + "docstring-parser==0.17", + "Flask[async]==3.1.1", + "multiprocess==0.70.18", + "Werkzeug==3.1.3", +] + +[tool.setuptools.packages.find] +where = ["."] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index bf0f231..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -docstring-parser==0.17 -Flask[async]==3.1.1 # you do not need flask to use this decorators. Flask is only needed you want to use @validate for Flask endpoints -multiprocess==0.70.18 -Werkzeug==3.1.3 diff --git a/setup.py b/setup.py deleted file mode 100644 index e9079b3..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from os import path - -from setuptools import find_packages, setup - - -def get_content_from_readme(file_name: str = 'README.md') -> str: - this_directory = path.abspath(path.dirname(__file__)) - - with open(path.join(this_directory, file_name), encoding='utf-8') as file: - return file.read() - - -url = "https://github.com/LostInDarkMath/pedantic-python-decorators" -author = "Willi Sontopski" - -setup( - name="pedantic", - version="2.1.11", - python_requires='>=3.11.0', - packages=find_packages(), - install_requires=[], - author=author, - author_email="willi_sontopski@arcor.de", - license="Apache-2.0 License", - maintainer=author, - description="Some useful Python decorators for cleaner software development.", - long_description=get_content_from_readme(), - long_description_content_type='text/markdown', - keywords="decorators tools helpers type-checking pedantic type annotations", - url=url, - project_urls={ - "Bug Tracker": f'{url}/issues', - "Documentation": 'https://lostindarkmath.github.io/pedantic-python-decorators/pedantic/', - "Source Code": url, - }, - include_package_data=False, - zip_safe=True, -)