Skip to content
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

Hatchbuild retry #379

Open
wants to merge 6 commits 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
13 changes: 0 additions & 13 deletions .coveragerc

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/373.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use hatchling build backend
238 changes: 223 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,235 @@
#
#
# See also https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
#
# General idea taken from
# https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/

[build-system]
requires = [
# sync with setup.py until we discard non-pep-517/518
"setuptools",
"setuptools-scm",
"wheel",
"build",
"hatchling>=1.8.0",
]
build-backend = "hatchling.build"

[project]
name = "semver"
description = "Python helper for Semantic Versioning (https://semver.org)"
readme = "README.rst"
requires-python = ">=3.7"
authors = [
{ name = "Kostiantyn Rybnikov", email = "k-bx@k-bx.com" },
]
maintainers = [
{ name = "Sebastien Celles", email = "s.celles@gmail.com" },
{ name = "Tom Schraitle" },
]
keywords = [
"python",
"version",
"semver",
"versioning",
"version",
"semantic-versioning",
"release",
"semver-format",
"semver-tag",
"semver-release",
"semver-cli",
]
classifiers = [
"Environment :: Web Environment",
"Development Status :: 5 - Production/Stable",
"Topic :: Software Development",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = []
dynamic = [
"version",
]

[project.urls]
Homepage = "https://github.com/python-semver/python-semver"
Changelog = "https://python-semver.readthedocs.io/en/latest/changelog.html"
Documentation = "https://python-semver.rtfd.io"
Releases = "https://github.com/python-semver/python-semver/releases"
Issues = "https://github.com/python-semver/python-semver/issues"

[project.license]
file = "LICENSE.txt"

[project.scripts]
pysemver = "semver.cli:main"

[tool.hatch.version]
path = "src/semver/__about__.py"

[tool.hatch.build.targets.wheel]
packages = [
"src/semver",
]

[tool.hatch.build.targets.wheel.force-include]
"src/semver/py.typed" = "semver/py.typed"

[tool.hatch.envs.default]
dependencies = [
"towncrier",
"wheel",
]

[tool.hatch.envs.style]
dependencies = [
"black",
"flake8",
"pycodestyle",
]
build-backend = "setuptools.build_meta"

[tool.hatch.envs.style.scripts]
fmt = [
"black .",
]
lint = [
"flake8 --exit-zero",
"pycodestyle",
]

[tool.hatch.envs.docs]
dependencies = [
#"sphinx",
"sphinx-argparse",
"sphinx-autodoc-typehints",
]

[tool.hatch.envs.docs.scripts]
build = "docs/make.bat -C docs html"
linkcheck = "docs/make.bat -C docs linkcheck"
serve = "python3 -m webbrowser -t docs/_build/html/index.html"

[tool.hatch.envs.test]
dependencies = [
"coverage[toml]",
"pytest-cov",
]

[[tool.hatch.envs.test.matrix]]
python = ["37", ]

[tool.hatch.envs.test.scripts]
cov = "pytest -vx"
no-cov = "cov --no-cov"

[tool.hatch.envs.testall]
dependencies = [
"coverage[toml]",
"pytest-cov",
]
[[tool.hatch.envs.testall.matrix]]
python = ["37", "38", "39", "310", "311", ]

[tool.hatch.envs.testall.scripts]
cov = "pytest -vx"
no-cov = "cov --no-cov"

[tool.hatch.envs.tox]
dependencies = [
"tox",
]

[tool.hatch.envs.tox.scripts]
test = "tox"

[tool.coverage.run]
source = [
"semver",
#"src/semver/*",
]
branch = true
parallel = true
omit = [
# add files to exclude them from the coverage report, e.g.
"src/semver/_types.py",
]

[tool.coverage.report]
show_missing = true
precision = 1
exclude_lines = [
"no cover",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
# note the use of single quote below to denote "raw" strings in TOML
'if not hasattr\(__builtins__, .cmp.\):',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]

[tool.mypy]
# the mypy settings go here
# To have the `py.typed` file installed with the package we had to include it
# in the build metadata (see [tool.hatch.build.targets.wheel.force-include])
enable_error_code = [
"ignore-without-code",
]
show_error_codes = true
warn_unused_ignores = true
implicit_reexport = true
pretty = true
follow_imports = "normal"

[tool.pytest.ini_options]
norecursedirs = [
".git",
"build",
".env/",
"env/",
".pyenv/",
".tmp/",
".eggs/",
"venv/",
]
testpaths = [
"tests",
"docs",
]
filterwarnings = [
"ignore::DeprecationWarning",
'ignore:Function semver.*:DeprecationWarning',
]
addopts = [
"--no-cov-on-fail",
"--cov=semver",
"--cov-report=term-missing",
"--doctest-glob='*.rst'",
"--doctest-modules",
"--doctest-report ndiff",
]

# flake8 does not support configuration in pyproject.toml
# see https://github.com/PyCQA/flake8/issues/234
# (there are alternatives, e.g. https://github.com/john-hen/Flake8-pyproject)
# we stick to the original flake8 with configuration
# in the `[flake8]` section of setup.cfg

# pycodestyle does not support configuration in pyproject.toml
# We stick to the original pycodestyle configuration
# in the `[pycodestyle]` section of setup.cfg

[tool.black]
line-length = 88
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
target-version = ["py36", "py37", "py38", "py39", "py310", "py311"]
# diff = true

# note the use of single quotes below to denote "raw" strings in TOML
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
^/*.py
'''
include = '''
^/setup.py
'''

[tool.towncrier]
package = "semver"
Expand Down
70 changes: 0 additions & 70 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,73 +1,3 @@
#
# Metadata for setup.py
#
# See https://setuptools.rtfd.io/en/latest/userguide/declarative_config.html

[metadata]
name = semver
version = attr: semver.__about__.__version__
description = Python helper for Semantic Versioning (https://semver.org)
long_description = file: README.rst
long_description_content_type = text/x-rst
author = Kostiantyn Rybnikov
author_email = k-bx@k-bx.com
maintainer = Sebastien Celles, Tom Schraitle
maintainer_email = s.celles@gmail.com
url = https://github.com/python-semver/python-semver
project_urls =
Changelog = https://python-semver.readthedocs.io/en/latest/changelog.html
Documentation = https://python-semver.rtfd.io
Releases = https://github.com/python-semver/python-semver/releases
Bug Tracker = https://github.com/python-semver/python-semver/issues
classifiers =
Environment :: Web Environment
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
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 :: Libraries :: Python Modules
license = BSD

[options]
package_dir =
=src
packages = find:
python_requires = >=3.7
include_package_data = True

[options.entry_points]
console_scripts =
pysemver = semver.cli:main

[options.packages.find]
where = src

[options.package_data]
semver = py.typed

[tool:pytest]
norecursedirs = .git build .env/ env/ .pyenv/ .tmp/ .eggs/ venv/
testpaths = tests docs
pythonpath = src tests
filterwarnings =
ignore:Function 'semver.*:DeprecationWarning
# ' <- This apostroph is just to fix syntax highlighting
addopts =
--import-mode=importlib
--no-cov-on-fail
--cov=semver
--cov-report=term-missing
--doctest-glob='*.rst'
--doctest-modules
--doctest-report ndiff

[flake8]
max-line-length = 88
ignore = F821,W503
Expand Down