From 9b70dd864b18e18993e0ecf96f9e3f9b37e47552 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Sun, 2 Jul 2023 10:09:31 +0800 Subject: [PATCH 1/5] Use pyproject.toml for packaging Signed-off-by: Chenxiong Qi --- .github/workflows/distribution.yaml | 9 ++- pyproject.toml | 90 +++++++++++++++++++++++++++++ setup.cfg | 82 -------------------------- setup.py | 3 - 4 files changed, 98 insertions(+), 86 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/distribution.yaml b/.github/workflows/distribution.yaml index aee833762..9034a5f76 100644 --- a/.github/workflows/distribution.yaml +++ b/.github/workflows/distribution.yaml @@ -8,7 +8,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: python setup.py sdist + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: make sdist + run: | + python3 -m venv venv + ./venv/bin/pip install build + ./venv/bin/python3 -m build --sdist - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@master with: diff --git a/pyproject.toml b/pyproject.toml index bc88fd5f5..975e74e21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,96 @@ [build-system] requires = ["setuptools", "wheel"] +[project] +name = "nitrate-tcms" +description = "A full-featured Test Case Management System" +readme = "README.rst" +authors = [ + {name = "Nitrate Team"} +] +maintainers = [ + {name = "Chenxiong Qi", email = "qcxhome@gmail.com"} +] +license = {text = "GPLv2+"} +keywords = ["test", "case", "plan", "run"] +requires-python = ">=3.9" +classifiers = [ + "Framework :: Django", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.2", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing" +] +dependencies = [ + "beautifulsoup4==4.11.1", + "django>=3.2,<4", + "django-contrib-comments==2.2.0", + "django-tinymce==3.5.0", + "django-uuslug==2.0.0", + "html2text==2020.1.16", + "odfpy==1.4.1", + "xmltodict==0.13.0", + "kobo==0.25.0", +] +dynamic = ["version"] + +[project.optional-dependencies] +mysql = ["mysqlclient==2.1.1"] +pgsql = ["psycopg2-binary==2.9.5"] +krbauth = ["kerberos==1.3.0"] +bugzilla = ["python-bugzilla==3.2.0"] +socialauth = ["social-auth-app-django==5.0.0"] +async = ["celery==5.2.6"] +docs = ["Sphinx >= 1.1.2", "sphinx_rtd_theme"] +devtools = [ + "black", + "django-debug-toolbar", + "django-stubs", + "tox", + # Build tool to build sdist: python3 -m build + "build", +] +tests = [ + "beautifulsoup4==4.11.1", + "coverage[toml]", + "factory_boy", + "flake8", + "pytest", + "pytest-cov", + "pytest-django", + "sqlparse", + "tox", + "tox-docker>=2.0.0", +] + +[project.urls] +Repository = "https://github.com/Nitrate/Nitrate" +Documentation = "https://nitrate.readthedocs.io/" +"Issue Tracker" = "https://github.com/Nitrate/Nitrate/issues" +"Source Code" = "https://github.com/Nitrate/Nitrate" +"Release Notes" = "https://nitrate.readthedocs.io/en/latest/releases/" +"Container Images" = "https://quay.io/organization/nitrate" + +[tool.setuptools] +platforms = ["any"] +zip-safe = false +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION.txt"} + +[tool.setuptools.packages.find] +where = ["src"] +exclude = ["tests*"] +namespaces = false + [tool.black] line-length = 100 target-version = ['py310'] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c532b9da2..000000000 --- a/setup.cfg +++ /dev/null @@ -1,82 +0,0 @@ -[metadata] -name = nitrate-tcms -version = file: VERSION.txt -description = A full-featured Test Case Management System -long_description = file: README.rst -author = Nitrate Team -maintainer = Chenxiong Qi -maintainer_email = qcxhome@gmail.com -url = https://github.com/Nitrate/Nitrate -license = GPLv2+ -keywords = test, case, plan, run -platforms = - any -classifiers = - Framework :: Django - Framework :: Django :: 3.2 - Framework :: Django :: 4.2 - Intended Audience :: Developers - License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3 :: Only - Topic :: Software Development :: Quality Assurance - Topic :: Software Development :: Testing -project_urls = - Issue Tracker = https://github.com/Nitrate/Nitrate/issues - Source Code = https://github.com/Nitrate/Nitrate - Documentation = https://nitrate.readthedocs.io/ - Release Notes = https://nitrate.readthedocs.io/en/latest/releases/ - Container Images = https://quay.io/organization/nitrate - -[options] -zip_safe = False -include_package_data = True -python_requires = >=3.9 -install_requires = - beautifulsoup4==4.11.1 - django>=3.2,<4 - django-contrib-comments==2.2.0 - django-tinymce==3.5.0 - django-uuslug==2.0.0 - html2text==2020.1.16 - odfpy==1.4.1 - xmltodict==0.13.0 - kobo==0.25.0 -package_dir= - =src -packages = find: - -[options.packages.find] -exclude = - test* -where = src - -[options.extras_require] -mysql = mysqlclient==2.1.1 -pgsql = psycopg2-binary==2.9.5 -krbauth = kerberos==1.3.0 -bugzilla = python-bugzilla==3.2.0 -socialauth = social-auth-app-django==5.0.0 -async = celery==5.2.6 -docs = - Sphinx >= 1.1.2 - sphinx_rtd_theme -devtools = - black - django-debug-toolbar - django-stubs - tox -tests = - beautifulsoup4==4.11.1 - coverage[toml] - factory_boy - flake8 - pytest - pytest-cov - pytest-django - sqlparse - tox - tox-docker>=2.0.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 23c3fe6f5..000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- -from setuptools import setup -setup() From 9fe217830b0397e2a35b88a2b2fdcc53895bdbe1 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Sun, 2 Jul 2023 15:51:59 +0800 Subject: [PATCH 2/5] Use release/v1 of pypa/gh-action-pypi-publish By referring to the project, master version has been deprecated already. Signed-off-by: Chenxiong Qi --- .github/workflows/distribution.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/distribution.yaml b/.github/workflows/distribution.yaml index 9034a5f76..92acc43c1 100644 --- a/.github/workflows/distribution.yaml +++ b/.github/workflows/distribution.yaml @@ -17,7 +17,7 @@ jobs: ./venv/bin/pip install build ./venv/bin/python3 -m build --sdist - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.pypi_token }} From 9d0e90cebc0923f590350d524b961a7a5125c741 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Sun, 2 Jul 2023 16:59:35 +0800 Subject: [PATCH 3/5] Remove docs/requirements.txt from MANIFEST.in This file has been removed already. Signed-off-by: Chenxiong Qi --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index fb0403e5f..e0f699257 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -13,7 +13,7 @@ graft src/static graft src/templates graft tests -include docs/Makefile docs/requirements.txt docs/make.bat +include docs/Makefile docs/make.bat graft docs/source global-exclude *.pyc From 5267028f0204b343bde49575e47273e67afd11a7 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Sun, 2 Jul 2023 22:45:10 +0800 Subject: [PATCH 4/5] Rename GH action task name Signed-off-by: Chenxiong Qi --- .github/workflows/distribution.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/distribution.yaml b/.github/workflows/distribution.yaml index 92acc43c1..5b7ee2a5c 100644 --- a/.github/workflows/distribution.yaml +++ b/.github/workflows/distribution.yaml @@ -16,7 +16,7 @@ jobs: python3 -m venv venv ./venv/bin/pip install build ./venv/bin/python3 -m build --sdist - - name: Publish distribution 📦 to PyPI + - name: Publish sdist package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ From b3e3c20231607b6b802ed490403c5b33c21f9c14 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Sun, 2 Jul 2023 22:46:56 +0800 Subject: [PATCH 5/5] Ignore more files Signed-off-by: Chenxiong Qi --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fb095b74c..a0193161a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .vagrant/ .tox/ .env/ +.venv/ .pytest_cache/ TAGS build/ @@ -26,6 +27,7 @@ tcms/toys.py cover-report/ htmlcov/ .cache/ +.dccache ./install/ uploads/ Vagrantfile