From f460cbc35bf6cf236bac6d3f2c7afc455057008c Mon Sep 17 00:00:00 2001 From: Marcelo Trevisani Date: Thu, 19 Oct 2023 18:39:32 +0100 Subject: [PATCH 1/4] Migrate to pyproject.toml --- .github/workflows/test.yml | 8 +++--- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++ setup.py | 42 ++------------------------- 3 files changed, 64 insertions(+), 44 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69ea024..5485e61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"] + python: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest, macos-latest] steps: @@ -48,12 +48,12 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install tox + - name: Install pkgs run: | python -m pip install --upgrade pip - pip install tox + python -m pip install dist/.[testing] - name: Test shell: bash run: | - tox run -e py --installpkg `find dist/*.tar.gz` + tox run -e py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c23cd7d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools >=61", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "pytest-datadir" +authors = [ + { name = "Gabriel Reis", email = "gabrielcnr@gmail.com" }, +] +description = "pytest plugin for test data directories and files" +keywords = ["pytest", "test", "unittest", "directory", "file"] +license = { text = "MIT" } +urls = {Homepage = "http://github.com/gabrielcnr/pytest-datadir"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", +] +dynamic = ["version"] +requires-python = ">=3.8" +dependencies = [ + "pytest>=5.0", +] + +[project.entry-points.pytest11] +pytest-datadir = "pytest_datadir.plugin" + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.optional-dependencies] +testing = [ + "pytest", + "tox", +] +dev = [ + "pytest-datadir[testing]", + "pre-commit", +] + +[tool.setuptools_scm] +write_to = "src/pytest_datadir/_version.py" + +[tool.setuptools.packages.find] +include = ["pytest_datadir", "pytest_datadir.*"] +where = ["src"] + +[tool.pytest.ini_options] +testpaths = ["tests"] diff --git a/setup.py b/setup.py index 8309810..6305922 100644 --- a/setup.py +++ b/setup.py @@ -1,42 +1,4 @@ -import io - -from setuptools import find_packages from setuptools import setup -with io.open("README.md", encoding="UTF-8") as fp: - long_description = fp.read() - - -setup( - name="pytest-datadir", - use_scm_version={"write_to": "src/pytest_datadir/_version.py"}, - packages=find_packages(where="src"), - entry_points={ - "pytest11": ["pytest-datadir = pytest_datadir.plugin"], - }, - package_dir={"": "src"}, - setup_requires=["setuptools_scm"], - install_requires=["pytest>=5.0"], - author="Gabriel Reis", - author_email="gabrielcnr@gmail.com", - description="pytest plugin for test data directories and files", - long_description=long_description, - long_description_content_type="text/markdown", - license="MIT", - keywords="pytest test unittest directory file", - url="http://github.com/gabrielcnr/pytest-datadir", - python_requires=">=3.8", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Quality Assurance", - "Topic :: Software Development :: Testing", - ], -) +# Please check pyproject.toml for metadata +setup(name="pytest-datadir") From 60a1d6bc4756778c76e94786a9c6b4f226a77c47 Mon Sep 17 00:00:00 2001 From: Marcelo Trevisani Date: Thu, 19 Oct 2023 18:42:39 +0100 Subject: [PATCH 2/4] Change to install pkg in dev mode --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5485e61..fc4e4f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,7 @@ jobs: - name: Install pkgs run: | python -m pip install --upgrade pip - python -m pip install dist/.[testing] + python -m pip install -e .[testing] - name: Test shell: bash From f8eea52aabe2de29658fd87a75d9b774b8f18478 Mon Sep 17 00:00:00 2001 From: Marcelo Trevisani Date: Tue, 7 Nov 2023 06:35:12 +0000 Subject: [PATCH 3/4] Using tox to install and kick tests --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc4e4f0..599fd44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,12 +48,12 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install pkgs + - name: Install tox run: | python -m pip install --upgrade pip - python -m pip install -e .[testing] + python -m pip install tox - name: Test shell: bash run: | - tox run -e py + tox run -e py --installpkg `find dist/*.tar.gz` From 83ff7c69c3f4c333f4a7aac08a64cd4ebccf8c8d Mon Sep 17 00:00:00 2001 From: Marcelo Duarte Trevisani Date: Wed, 8 Nov 2023 13:38:02 +0000 Subject: [PATCH 4/4] remove name in setup.py Co-authored-by: Bruno Oliveira --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6305922..14ace29 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ from setuptools import setup # Please check pyproject.toml for metadata -setup(name="pytest-datadir") +setup()