From 4658c5d1cb6b486a6e9c0fcdb1384d4e809d9a93 Mon Sep 17 00:00:00 2001 From: kaliko Date: Mon, 14 Oct 2024 18:02:51 +0200 Subject: [PATCH 1/7] Moving to pyproject.toml --- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 26 -------------------------- setup.py | 42 ------------------------------------------ 3 files changed, 45 insertions(+), 68 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 10572daa..932f9fa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[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 = ["borgmatic"] + [tool.black] line-length = 100 skip-string-normalization = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a5ba3a6a..00000000 --- a/setup.cfg +++ /dev/null @@ -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 diff --git a/setup.py b/setup.py deleted file mode 100644 index 7252ddd0..00000000 --- a/setup.py +++ /dev/null @@ -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', -) -- 2.52.0 From 9e29ce788f5539da63372eb0ddfb40045ca2ecb7 Mon Sep 17 00:00:00 2001 From: kaliko Date: Mon, 14 Oct 2024 18:11:05 +0200 Subject: [PATCH 2/7] Fixed release script --- scripts/release | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/release b/scripts/release index b4ab65cf..f84681db 100755 --- a/scripts/release +++ b/scripts/release @@ -33,8 +33,7 @@ git push github $version # Build borgmatic and publish to pypi. 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-*-py3-none-any.whl -- 2.52.0 From d96c5f79fb233bafeeef4f9b19159c1d4890c159 Mon Sep 17 00:00:00 2001 From: kaliko Date: Mon, 14 Oct 2024 18:30:39 +0200 Subject: [PATCH 3/7] Add pytest to pyproject.toml --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 932f9fa0..c4bf56bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,3 +46,7 @@ packages = ["borgmatic"] [tool.black] line-length = 100 skip-string-normalization = true + +[tool.pytest.ini_options] +testpaths = "tests" +addopts = "--cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/end-to-end" -- 2.52.0 From 33b1101ce1023df3d5ef9d88fc69f4318056715f Mon Sep 17 00:00:00 2001 From: kaliko Date: Mon, 14 Oct 2024 18:32:28 +0200 Subject: [PATCH 4/7] Add isort to pyproject.toml --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c4bf56bb..4a252319 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,3 +50,9 @@ 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" -- 2.52.0 From b029d1cb67facb32f0e887e8d9ccb1411200de90 Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 15 Oct 2024 09:46:53 +0200 Subject: [PATCH 5/7] Add codespell to pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4a252319..fda99d14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,3 +56,6 @@ profile = "black" known_first_party = "borgmatic" line_length = 100 skip = ".tox" + +[tool.codespell] +skip = ".git,.tox,build" -- 2.52.0 From 601e393ec72886eefece99b107cb8792442c0263 Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 22 Oct 2024 21:32:29 +0200 Subject: [PATCH 6/7] Fixed package discovery in pyproject.toml --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fda99d14..978a484d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,8 +40,9 @@ requires = ["setuptools>=61.0"] # allow looking for conf in setup.{cfg,py} #build-backend = "setuptools.build_meta" -[tool.setuptools] -packages = ["borgmatic"] +[tool.setuptools.packages.find] +include = ["borgmatic*"] +namespaces = false [tool.black] line-length = 100 -- 2.52.0 From bd9751586ca883caeb3a756a14808c5988a30013 Mon Sep 17 00:00:00 2001 From: kaliko Date: Sat, 26 Oct 2024 20:11:39 +0200 Subject: [PATCH 7/7] Merge blake8 conf to tox.ini --- .flake8 | 1 - tox.ini | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 5d931745..00000000 --- a/.flake8 +++ /dev/null @@ -1 +0,0 @@ -select = Q0 diff --git a/tox.ini b/tox.ini index 098a8926..6685b88b 100644 --- a/tox.ini +++ b/tox.ini @@ -45,3 +45,10 @@ commands = deps = {[testenv]deps} commands = codespell --write-changes + +[flake8] +max-line-length = 100 +extend-ignore = E203,E501,W503 +exclude = *.*/* +multiline-quotes = ''' +docstring-quotes = ''' -- 2.52.0