Skip to content

Move buildbackend from setuptools/pbr to hatchling #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install testtools pbr ruff
python -m pip install testtools ruff
- name: Run ruff
run: |
python -m ruff check .
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
TAGS
tags
lib/testtools
MANIFEST
build
dist
*~
Expand All @@ -11,5 +10,5 @@ testscenarios.egg-info
*.pyc
__pycache__
*.egg
ChangeLog
AUTHORS
testscenarios/_version.py
tox.ini
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ TAGS: testscenarios/*.py testscenarios/tests/*.py
tags: testscenarios/*.py testscenarios/tests/*.py
ctags -R testscenarios/

release:
python setup.py sdist bdist_wheel upload -s

.PHONY: all check release
.PHONY: all check
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "testscenarios"
description = "Testscenarios, a pyunit extension for dependency injection"
readme = "README.rst"
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
]
authors = [{name = "Testing-cabal", email = "[email protected]"}]
license = {text = "Apache-2.0 or BSD"}
requires-python = ">=3.8"
dynamic = ["version"]

[project.urls]
Homepage = "https://launchpad.net/testscenarios"
"Bug Tracker" = "https://bugs.launchpad.net/testscenarios"
"Source Code" = "https://github.com/testing-cabal/testscenarios"

[project.optional-dependencies]
"test" = ["testtools"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "testscenarios/_version.py"

[tool.hatch.build.targets.sdist]
include = [
"testscenarios*",
"APACHE-2.0",
"AUTHORS",
"BSD",
"ChangeLog",
"COPYING",
"GOALS",
"HACKING",
"Makefile",
"NEWS",
"README.rst",
"tox.ini",
"doc/*.py",
]
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pbr >= 0.11
testtools
23 changes: 0 additions & 23 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

17 changes: 2 additions & 15 deletions testscenarios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,7 @@
methods for details.
"""

# same format as sys.version_info: "A tuple containing the five components of
# the version number: major, minor, micro, releaselevel, and serial. All
# values except releaselevel are integers; the release level is 'alpha',
# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
# releaselevel of 'dev' for unreleased under-development code.
#
# If the releaselevel is 'alpha' then the major/minor/micro components are not
# established at this point, and setup.py will use a version of next-$(revno).
# If the releaselevel is 'final', then the tarball will be major.minor.micro.
# Otherwise it is major.minor.micro~$(revno).
from pbr.version import VersionInfo
_version = VersionInfo('testscenarios')
__version__ = _version.semantic_version().version_tuple()
version = _version.release_string()
from testscenarios._version import __version__

__all__ = [
'TestWithScenarios',
Expand All @@ -52,6 +38,7 @@
'load_tests_apply_scenarios',
'multiply_scenarios',
'per_module_scenarios',
'__version__',
]


Expand Down
Loading