diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3aed56d..0000000 --- a/.coveragerc +++ /dev/null @@ -1,15 +0,0 @@ -[run] -branch = True -source = src/borg_import -omit = - */borg_import/helpers/testsuite/* - -[report] -exclude_lines = - pragma: no cover - def __repr__ - raise AssertionError - raise NotImplementedError - if 0: - if __name__ == .__main__.: -ignore_errors = True diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5832787..a808d8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,30 +13,31 @@ jobs: python-version: "3.11" - name: Lint with flake8 run: | - pip install flake8 + pip install flake8-pyproject flake8 test: needs: lint - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - - os: ubuntu-22.04 - python-version: "3.8" - toxenv: py38 - os: ubuntu-22.04 python-version: "3.9" toxenv: py39 - - os: ubuntu-22.04 + - os: ubuntu-24.04 python-version: "3.10" toxenv: py310 - - os: ubuntu-22.04 + - os: ubuntu-24.04 python-version: "3.11" toxenv: py311 - - os: ubuntu-22.04 + - os: ubuntu-24.04 python-version: "3.12" toxenv: py312 + - os: ubuntu-24.04 + python-version: "3.13" + toxenv: py313 + env: TOXENV: ${{ matrix.toxenv }} steps: diff --git a/.gitignore b/.gitignore index 69e6cc2..80905c8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ borg-env *.pyo .idea/ .cache/ +.coverage src/borg_import/_version.py .eggs/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b689a8b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,91 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "borg-import" +description = "Import backups made with misc. other software into borgbackup" +readme = "README.rst" +authors = [ + {name = "The Borg Collective (see AUTHORS file)", email = "borgbackup@python.org"} +] +license = {text = "BSD"} +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: BSD License", + "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", + "Programming Language :: Python :: 3.13", + "Topic :: System :: Archiving :: Backup", +] +requires-python = ">=3.9" +dynamic = ["version"] + +[project.urls] +Homepage = "https://borgimport.readthedocs.io/" + +[project.scripts] +borg-import = "borg_import.main:main" + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true +zip-safe = false + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools_scm] +write_to = "src/borg_import/_version.py" + +[tool.pytest] +python_files = "testsuite/*.py" +testpaths = ["src"] + +[tool.pytest.ini_options] +addopts = "-rs --cov=borg_import --cov-config=pyproject.toml" + +[tool.flake8] +max-line-length = 120 +exclude = "build,dist,.git,.idea,.cache,.tox,docs/conf.py,.eggs" + +[tool.coverage.run] +branch = true +source = ["src/borg_import"] +omit = ["*/borg_import/helpers/testsuite/*"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "raise AssertionError", + "raise NotImplementedError", + "if 0:", + "if __name__ == .__main__.:" +] +ignore_errors = true + +[tool.tox] +env_list = ["py39", "py310", "py311", "py312", "py313", "flake8"] + +[tool.tox.env_run_base] +package = "editable-legacy" +passenv = ["*"] + +[tool.tox.env_pkg_base] +passenv = ["*"] + +[tool.tox.env.testenv] +deps = ["-rrequirements.d/development.txt"] +commands = [["pytest", "-rs", "--cov=borg_import", "--cov-config=pyproject.toml", "--pyargs={posargs:borg_import.helpers.testsuite}"]] + +[tool.tox.env.flake8] +deps = ["flake8-pyproject"] +commands = [["flake8"]] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f9507d6..0000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[tool:pytest] -python_files = testsuite/*.py - -[flake8] -max-line-length = 120 -exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py,.eggs diff --git a/setup.py b/setup.py deleted file mode 100644 index 6493b70..0000000 --- a/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- encoding: utf-8 *-* -from setuptools import setup, find_packages - -with open('README.rst', 'r') as fd: - long_description = fd.read() - -setup( - name='borg-import', - use_scm_version={ - 'write_to': 'src/borg_import/_version.py', - }, - author='The Borg Collective (see AUTHORS file)', - author_email='borgbackup@python.org', - url='https://borgimport.readthedocs.io/', - description='Import backups made with misc. other software into borgbackup', - long_description=long_description, - license='BSD', - platforms=['Linux', ], - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Environment :: Console', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: BSD License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - '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 :: System :: Archiving :: Backup', - ], - packages=find_packages('src'), - package_dir={'': 'src'}, - include_package_data=True, - zip_safe=False, - entry_points={ - 'console_scripts': [ - 'borg-import = borg_import.main:main', - ] - }, - setup_requires=['setuptools_scm>=1.7', ], - install_requires=[], - python_requires=">=3.8", -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 50f8452..0000000 --- a/tox.ini +++ /dev/null @@ -1,18 +0,0 @@ -# tox configuration - if you change anything here, run this to verify: -# fakeroot -u tox --recreate - -[tox] -envlist = py{38,39,310,311,312},flake8 - -[testenv] -usedevelop = True -deps = - -rrequirements.d/development.txt -commands = py.test -rs --cov=borg_import --cov-config=.coveragerc --pyargs {posargs:borg_import.helpers.testsuite} -# fakeroot -u needs some env vars: -passenv = * - -[testenv:flake8] -changedir = -deps = flake8 -commands = flake8