From 65590cd4c75252a51f12512ad325e56e2c49419d Mon Sep 17 00:00:00 2001 From: Lennart Regebro Date: Wed, 18 Oct 2023 12:18:08 +0200 Subject: [PATCH] Move to pyproject.toml (#93) --- .flake8 | 2 + .github/workflows/python-package.yml | 33 +++++--------- Makefile | 2 +- pyproject.toml | 61 ++++++++++++++++++++++++++ setup.cfg | 65 ---------------------------- setup.py | 3 -- 6 files changed, 74 insertions(+), 92 deletions(-) create mode 100644 .flake8 create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6deafc2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 193026e..2b7a534 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -17,31 +17,18 @@ jobs: fail-fast: true steps: - uses: actions/checkout@v3 - - name: Install dependencies + - name: Install Package run: | - python -m pip install setuptools==58.2.0 -e .[devenv] - sudo apt-get update - sudo apt-get install libreoffice - - name: Check style with black - run: | - # stop the build if there are Python syntax errors or undefined names - black . --check - - name: Lint with flake8 - run: | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --max-line-length=120 --statistics - - name: Check the packaging + python -m pip install virtualenv + make devenv + - name: Check styles run: | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - pyroma -d . - - name: And MANIFEST + make check + - name: Install Libreoffice run: | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - check-manifest + sudo apt-get update + sudo apt-get install libreoffice - name: Test with pytest run: | - PYTHONPATH=/ pytest --cov=unoserver - coverage xml - - name: Upload coverage - run: | - bash <(curl -Ls https://coverage.codacy.com/get.sh) report -t 6ebaf74314ff4ccd8e87d1f988a4aa2f -r coverage.xml + source ve/bin/activate + make test diff --git a/Makefile b/Makefile index 4414440..6740bd5 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ devenv: ve/bin/fullrelease ve/bin/fullrelease: virtualenv $(root_dir)/ve --python python3 --system-site-packages - $(bin_dir)/pip install setuptools$(setuptools_ver) -e .[devenv] + $(bin_dir)/pip install -I setuptools$(setuptools_ver) -e .[devenv] check: devenv $(bin_dir)/black src/unoserver tests diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d41e953 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "unoserver" +version = "2.0b2.dev0" +description = "A server for file conversions with Libre Office" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Topic :: Office/Business", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "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", + "License :: OSI Approved :: MIT License", +] +keywords = ["libreoffice", "conversion", "documents", "uno", "unoconv"] +authors = [{name = "Lennart Regebro", email = "regebro@gmail.com"}] +license = {text = "MIT"} +urls = {Homepage = "https://github.com/unoconv/unoserver"} +dynamic = ["readme"] +requires-python = ">= 3.8" + +[project.optional-dependencies] +devenv = [ + "pytest", + "pytest-cov", + "black", + "flake8", + "pyroma", + "check-manifest", + "zest.releaser", +] + +[project.scripts] +unoserver = "unoserver.server:main" +unoconvert = "unoserver.client:converter_main" +unocompare = "unoserver.client:comparer_main" + +[tool.setuptools] +packages = ["unoserver"] +package-dir = {"" = "src"} +include-package-data = true +zip-safe = false + +[tool.setuptools.dynamic] +readme = {file = ["README.rst", "CONTRIBUTORS.rst", "CHANGES.rst"]} + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.check-manifest] +ignore = """ +.pre-commit-config.yaml +tests/* +tests/documents/*""" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 54a02b7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,65 +0,0 @@ -[metadata] -name = unoserver -version = 2.0b2.dev0 -description = A server for file conversions with Libre Office -long_description = file: README.rst, CONTRIBUTORS.rst, CHANGES.rst -classifiers = - Development Status :: 5 - Production/Stable - Topic :: Office/Business - Operating System :: POSIX :: Linux - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - 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 - License :: OSI Approved :: MIT License -keywords = libreoffice,conversion,documents,uno,unoconv -author = Lennart Regebro -author_email = regebro@gmail.com -url = https://github.com/unoconv/unoserver -license = MIT - -[options] -packages = unoserver -package_dir = - = src -include_package_data = True -zip_safe = False -install_requires = - setuptools -test_suite = tests -python_requires = >= 3.8 - -[options.entry_points] -console_scripts = - unoserver = unoserver.server:main - unoconvert = unoserver.client:converter_main - unocompare = unoserver.client:comparer_main - -[options.extras_require] -devenv = - pytest - pytest-cov - black - flake8 - pyroma - check-manifest - zest.releaser - -[flake8] -max-line-length=120 - -[tool:pytest] -testpaths = - tests - -[check-manifest] -ignore = - .pre-commit-config.yaml - tests/* - tests/documents/* - -[bdist_wheel] -universal=0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup()