Parcourir la source

Replace setup.py with pyproject.toml.

Reviewed-on: https://projects.torsion.org/borgmatic-collective/borgmatic/pulls/922
Dan Helfman il y a 7 mois
Parent
commit
c7ca9bf844
6 fichiers modifiés avec 67 ajouts et 71 suppressions
  1. 0 1
      .flake8
  2. 59 0
      pyproject.toml
  3. 1 2
      scripts/release
  4. 0 26
      setup.cfg
  5. 0 42
      setup.py
  6. 7 0
      tox.ini

+ 0 - 1
.flake8

@@ -1 +0,0 @@
-select = Q0

+ 59 - 0
pyproject.toml

@@ -1,3 +1,62 @@
+[project]
+name = "borgmatic"
+version = "1.9.0.dev0"
+authors = [
+  { name="Dan Helfman", email="witten@torsion.org" },
+]
+description = "Simple, configuration-driven backup software for servers and workstations"
+readme = "README.md"
+requires-python = ">=3.8"
+classifiers=[
+    "Development Status :: 5 - Production/Stable",
+    "Environment :: Console",
+    "Intended Audience :: System Administrators",
+    "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
+    "Programming Language :: Python",
+    "Topic :: Security :: Cryptography",
+    "Topic :: System :: Archiving :: Backup",
+]
+dependencies = [
+  "colorama>=0.4.1,<0.5",
+  "jsonschema",
+  "packaging",
+  "requests",
+  "ruamel.yaml>0.15.0",
+]
+
+[project.scripts]
+borgmatic = "borgmatic.commands.borgmatic:main"
+generate-borgmatic-config = "borgmatic.commands.generate_config:main"
+validate-borgmatic-config = "borgmatic.commands.validate_config:main"
+
+[project.optional-dependencies]
+Apprise = ["apprise"]
+
+[project.urls]
+Homepage = "https://torsion.org/borgmatic"
+
+[build-system]
+requires = ["setuptools>=61.0"]
+# allow looking for conf in setup.{cfg,py}
+#build-backend = "setuptools.build_meta"
+
+[tool.setuptools.packages.find]
+include = ["borgmatic*"]
+namespaces = false
+
 [tool.black]
 [tool.black]
 line-length = 100
 line-length = 100
 skip-string-normalization = true
 skip-string-normalization = true
+
+[tool.pytest.ini_options]
+testpaths = "tests"
+addopts = "--cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/end-to-end"
+
+[tool.isort]
+profile = "black"
+known_first_party = "borgmatic"
+line_length = 100
+skip = ".tox"
+
+[tool.codespell]
+skip = ".git,.tox,build"

+ 1 - 2
scripts/release

@@ -33,8 +33,7 @@ git push github $version
 
 
 # Build borgmatic and publish to pypi.
 # Build borgmatic and publish to pypi.
 rm -fr dist
 rm -fr dist
-python3 setup.py bdist_wheel
-python3 setup.py sdist
+python3 -m build
 twine upload -r pypi --username __token__ dist/borgmatic-*.tar.gz
 twine upload -r pypi --username __token__ dist/borgmatic-*.tar.gz
 twine upload -r pypi --username __token__ dist/borgmatic-*-py3-none-any.whl
 twine upload -r pypi --username __token__ dist/borgmatic-*-py3-none-any.whl
 
 

+ 0 - 26
setup.cfg

@@ -1,26 +0,0 @@
-[metadata]
-description_file=README.md
-
-[tool:pytest]
-testpaths = tests
-addopts = --cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/end-to-end
-
-[flake8]
-max-line-length = 100
-extend-ignore = E203,E501,W503
-exclude = *.*/*
-multiline-quotes = '''
-docstring-quotes = '''
-
-[tool:isort]
-profile=black
-known_first_party = borgmatic
-line_length = 100
-skip = .tox
-
-[codespell]
-skip = .git,.tox,build
-
-[pycodestyle]
-ignore = E203
-max_line_length = 100

+ 0 - 42
setup.py

@@ -1,42 +0,0 @@
-from setuptools import find_packages, setup
-
-VERSION = '1.9.0.dev0'
-
-
-setup(
-    name='borgmatic',
-    version=VERSION,
-    description='Simple, configuration-driven backup software for servers and workstations',
-    author='Dan Helfman',
-    author_email='witten@torsion.org',
-    url='https://torsion.org/borgmatic',
-    classifiers=[
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Console',
-        'Intended Audience :: System Administrators',
-        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
-        'Programming Language :: Python',
-        'Topic :: Security :: Cryptography',
-        'Topic :: System :: Archiving :: Backup',
-    ],
-    packages=find_packages(exclude=['tests*']),
-    entry_points={
-        'console_scripts': [
-            'borgmatic = borgmatic.commands.borgmatic:main',
-            'generate-borgmatic-config = borgmatic.commands.generate_config:main',
-            'validate-borgmatic-config = borgmatic.commands.validate_config:main',
-        ]
-    },
-    obsoletes=['atticmatic'],
-    install_requires=(
-        'colorama>=0.4.1,<0.5',
-        'jsonschema',
-        'packaging',
-        'requests',
-        'ruamel.yaml>0.15.0',
-        'setuptools',
-    ),
-    extras_require={"Apprise": ["apprise"]},
-    include_package_data=True,
-    python_requires='>=3.8',
-)

+ 7 - 0
tox.ini

@@ -45,3 +45,10 @@ commands =
 deps = {[testenv]deps}
 deps = {[testenv]deps}
 commands =
 commands =
     codespell --write-changes
     codespell --write-changes
+
+[flake8]
+max-line-length = 100
+extend-ignore = E203,E501,W503
+exclude = *.*/*
+multiline-quotes = '''
+docstring-quotes = '''