Browse Source

move most settings to pyproject.toml

except: flake8, which will get replaced by ruff.
Thomas Waldmann 1 year ago
parent
commit
d4f6f137c3
3 changed files with 82 additions and 84 deletions
  1. 79 0
      pyproject.toml
  2. 0 5
      setup.cfg
  3. 3 79
      setup.py

+ 79 - 0
pyproject.toml

@@ -1,3 +1,76 @@
+[project]
+name = "borgbackup"
+dynamic = ["version"]
+authors = [{name="The Borg Collective (see AUTHORS file)"}]
+maintainers = [
+    {name="Thomas Waldmann", email="tw@waldmann-edv.de"},
+]
+description = "Deduplicated, encrypted, authenticated and compressed backups"
+readme = "README.rst"
+requires-python = ">=3.9"
+keywords = ["backup", "borgbackup"]
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Environment :: Console",
+    "Intended Audience :: System Administrators",
+    "License :: OSI Approved :: BSD License",
+    "Operating System :: POSIX :: BSD :: FreeBSD",
+    "Operating System :: POSIX :: BSD :: OpenBSD",
+    "Operating System :: POSIX :: BSD :: NetBSD",
+    "Operating System :: MacOS :: MacOS X",
+    "Operating System :: POSIX :: Linux",
+    "Programming Language :: Python",
+    "Programming Language :: Python :: 3",
+    "Programming Language :: Python :: 3.9",
+    "Programming Language :: Python :: 3.10",
+    "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
+    "Topic :: Security :: Cryptography",
+    "Topic :: System :: Archiving :: Backup",
+]
+license = {text="BSD"}
+dependencies = [
+    # we are rather picky about msgpack versions, because a good working msgpack is
+    # very important for borg, see: https://github.com/borgbackup/borg/issues/3753
+    # Please note:
+    # using any other msgpack version is not supported by borg development and
+    # any feedback related to issues caused by this will be ignored.
+    "msgpack >=1.0.3, <=1.0.7",
+    "packaging",
+]
+
+# note for package maintainers: if you package borgbackup for distribution,
+# please (if available) add pyfuse3 (preferably) or llfuse as a *requirement*.
+# "borg mount" needs one of them to work.
+# if neither is available, do not require it, most of borgbackup will work.
+[project.optional-dependencies]
+llfuse = ["llfuse >= 1.3.8"]
+pyfuse3 = ["pyfuse3 >= 3.1.1"]
+nofuse = []
+
+[project.urls]
+"Homepage" = "https://borgbackup.org/"
+"Bug Tracker" = "https://github.com/borgbackup/borg/issues"
+"Documentation" = "https://borgbackup.readthedocs.io/"
+"Repository" = "https://github.com/borgbackup/borg"
+"Changelog" = "https://github.com/borgbackup/borg/blob/1.4-maint/docs/changes.rst"
+
+[project.scripts]
+borg = "borg.archiver:main"
+borgfs = "borg.archiver:main"
+
+[tool.setuptools]
+# See also the MANIFEST.in file.
+# We want to install all the files in the package directories...
+include-package-data = true
+
+[tool.setuptools.packages.find]
+where = ["src"]
+
+[tool.setuptools.exclude-package-data]
+# ...except the source files which have been compiled (C extensions):
+"*" = ["*.c", "*.h", "*.pyx"]
+
 [build-system]
 requires = ["setuptools>=64", "setuptools_scm>=8", "wheel", "pkgconfig", "Cython>=3"]
 build-backend = "setuptools.build_meta"
@@ -8,3 +81,9 @@ build-backend = "setuptools.build_meta"
 # https://github.com/borgbackup/borg/issues/6875
 write_to = "src/borg/_version.py"
 write_to_template = "__version__ = version = {version!r}\n"
+
+[tool.pytest.ini_options]
+python_files = "testsuite/*.py"
+markers = [
+    "allow_cache_wipe",
+]

+ 0 - 5
setup.cfg

@@ -1,8 +1,3 @@
-[tool:pytest]
-python_files = testsuite/*.py
-markers =
-    allow_cache_wipe
-
 [flake8]
 # for reference ...
 #   E121 continuation line under-indented for hanging indent

+ 3 - 79
setup.py

@@ -1,4 +1,4 @@
-# borgbackup - main setup code (see also other setup_*.py files)
+# borgbackup - main setup code (see also pyproject.toml and other setup_*.py files)
 
 import os
 import sys
@@ -11,7 +11,7 @@ except ImportError:
     multiprocessing = None
 
 from setuptools.command.build_ext import build_ext
-from setuptools import setup, find_namespace_packages, Extension, Command
+from setuptools import setup, Extension, Command
 from setuptools.command.sdist import sdist
 
 try:
@@ -64,30 +64,6 @@ cpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing
 # Are we building on ReadTheDocs?
 on_rtd = os.environ.get('READTHEDOCS')
 
-install_requires = [
-    # we are rather picky about msgpack versions, because a good working msgpack is
-    # very important for borg, see: https://github.com/borgbackup/borg/issues/3753
-    # Please note:
-    # using any other msgpack version is not supported by borg development and
-    # any feedback related to issues caused by this will be ignored.
-    'msgpack >=1.0.2, <=1.0.7',
-    'packaging',
-]
-
-# note for package maintainers: if you package borgbackup for distribution,
-# please (if available) add pyfuse3 (preferably) or llfuse (not maintained any more)
-# as a *requirement*. "borg mount" needs one of them to work.
-# if neither is available, do not require it, most of borgbackup will work.
-extras_require = {
-    'llfuse': [
-        'llfuse >= 1.3.8',
-    ],
-    'pyfuse3': [
-        'pyfuse3 >= 3.1.1',
-    ],
-    'nofuse': [],
-}
-
 # Extra cflags for all extensions, usually just warnings we want to explicitly enable
 cflags = [
     '-Wall',
@@ -257,56 +233,4 @@ if not on_rtd:
         # generate C code from Cython for THIS platform (and for all platform-independent Cython parts).
         ext_modules = cythonize(ext_modules, **cython_opts)
 
-# make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files
-# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
-# https://github.com/borgbackup/borg/issues/6875
-setup(
-    name='borgbackup',
-    author='The Borg Collective (see AUTHORS file)',
-    author_email='borgbackup@python.org',
-    url='https://borgbackup.readthedocs.io/',
-    description='Deduplicated, encrypted, authenticated and compressed backups',
-    long_description=setup_docs.long_desc_from_readme(),
-    license='BSD',
-    platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],
-    classifiers=[
-        'Development Status :: 4 - Beta',
-        'Environment :: Console',
-        'Intended Audience :: System Administrators',
-        'License :: OSI Approved :: BSD License',
-        'Operating System :: POSIX :: BSD :: FreeBSD',
-        'Operating System :: POSIX :: BSD :: OpenBSD',
-        'Operating System :: POSIX :: BSD :: NetBSD',
-        'Operating System :: MacOS :: MacOS X',
-        'Operating System :: POSIX :: Linux',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.9',
-        'Programming Language :: Python :: 3.10',
-        'Programming Language :: Python :: 3.11',
-        'Programming Language :: Python :: 3.12',
-        'Topic :: Security :: Cryptography',
-        'Topic :: System :: Archiving :: Backup',
-    ],
-    packages=find_namespace_packages('src'),
-    package_dir={'': 'src'},
-    zip_safe=False,
-    entry_points={
-        'console_scripts': [
-            'borg = borg.archiver:main',
-            'borgfs = borg.archiver:main',
-        ]
-    },
-    # See also the MANIFEST.in file.
-    # We want to install all the files in the package directories...
-    include_package_data=True,
-    # ...except the source files which have been compiled (C extensions):
-    exclude_package_data={
-        '': ['*.c', '*.h', '*.pyx', ],
-    },
-    cmdclass=cmdclass,
-    ext_modules=ext_modules,
-    install_requires=install_requires,
-    extras_require=extras_require,
-    python_requires='>=3.9',
-)
+setup(cmdclass=cmdclass, ext_modules=ext_modules, long_description=setup_docs.long_desc_from_readme())