Skip to content
Snippets Groups Projects
Commit e73901b0 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[pyproject] Use hatch and versioningit for modern project management

parent 6e65350c
No related branches found
No related tags found
1 merge request!19Use hatch and versioningit for modern project management
Pipeline #85439 failed
......@@ -13,7 +13,6 @@
coverage.xml
test_results.xml
junit-coverage.xml
environment.yaml
html/
build/
doc/api/
......
# SPDX-FileCopyrightText: Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: BSD-3-Clause
include LICENSES/*.txt
recursive-include doc *.rst *.txt *.py
recursive-include tests *.py *.cfg
......@@ -2,11 +2,9 @@
#
# SPDX-License-Identifier: BSD-3-Clause
{% set data = load_file_data(RECIPE_DIR + '/../pyproject.toml') %}
package:
name: {{ data['project']['name'] }}
version: {{ data['project']['version'] }}
version: {{ environ.get('PACKAGE_VERSION', environ.get('GIT_DESCRIBE_TAG')) }}
source:
path: ..
......
......@@ -3,34 +3,53 @@
# SPDX-License-Identifier: BSD-3-Clause
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"
[project]
name = "clapper"
version = "1.0.2b0"
dynamic = ["version"]
requires-python = ">=3.10"
description = "Configuration Support for Python Packages and CLIs"
readme = "README.md"
license = {text = "BSD 3-Clause License"}
authors = [
{name = "Andre Anjos", email = "andre.anjos@idiap.ch"},
]
license = { text = "BSD 3-Clause License" }
authors = [{ name = "Andre Anjos", email = "andre.anjos@idiap.ch" }]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"click>=8",
"tomli",
"tomli-w",
"xdg",
dependencies = ["click>=8", "tomli", "tomli-w", "xdg"]
[tool.hatch.version]
source = "versioningit"
[tool.versioningit.next-version]
method = "smallest"
[tool.versioningit.format]
# Example formatted version: 1.2.4.dev42+ge174a1f
distance = "{next_version}.dev{distance}+{vcs}{rev}"
# Example formatted version: 1.2.4.dev42+ge174a1f.d20230922
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
[tool.hatch.build.targets.sdist]
include = [
"src/**/*.py",
"tests/**/*.py",
"tests/**/*.cfg",
"doc/**/*.rst",
"doc/**/*.txt",
"doc/**/*.py",
"LICENSES/*.txt",
]
[tool.hatch.build.targets.wheel]
packages = ["src/clapper"]
[project.urls]
documentation = "https://clapper.readthedocs.io/en/latest/"
homepage = "https://pypi.org/project/clapper"
......@@ -40,19 +59,15 @@ changelog = "https://gitlab.idiap.ch/software/clapper/-/releases"
[project.optional-dependencies]
qa = ["pre-commit"]
doc = [
"sphinx",
"furo",
"sphinx-autodoc-typehints",
"sphinxcontrib-programoutput",
"auto-intersphinx",
"sphinx-copybutton",
"sphinx-inline-tabs",
]
test = [
"pytest",
"pytest-cov",
"coverage",
]
"sphinx",
"furo",
"sphinx-autodoc-typehints",
"sphinxcontrib-programoutput",
"auto-intersphinx",
"sphinx-copybutton",
"sphinx-inline-tabs",
]
test = ["pytest", "pytest-cov", "coverage"]
[project.entry-points."clapper.test.config"]
first = "tests.data.basic_config"
......@@ -66,13 +81,6 @@ complex-var = "tests.data.complex:cplx"
verbose-config = "tests.data.verbose_config"
error-config = "tests.data.doesnt_exist"
[tool.setuptools]
zip-safe = true
package-dir = {"" = "src"}
[tool.distutils.bdist_wheel]
universal = true
[tool.isort]
profile = "black"
line_length = 80
......@@ -83,10 +91,6 @@ lines_between_types = 1
line-length = 80
[tool.pytest.ini_options]
addopts = [
"--cov=clapper",
"--cov-report=term-missing",
"--import-mode=append",
]
addopts = ["--cov=clapper", "--cov-report=term-missing", "--import-mode=append"]
junit_logging = "all"
junit_log_passing_tests = false
# SPDX-FileCopyrightText: Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: BSD-3-Clause
from setuptools import setup
setup()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment