diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3f826f5..057f0c8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,8 +32,8 @@ jobs: run: | sudo apt-get update sudo apt-get upgrade -y - sudo apt-get install -y build-essential python-setuptools python3-pip - pip3 install setuptools + sudo apt-get install -y build-essential python3-pip fakeroot build-essential devscripts debhelper + pip3 install build wheel2deb - name: Checkout uses: actions/checkout@v2 @@ -44,26 +44,22 @@ jobs: id: get_version uses: battila7/get-version-action@v2 - - name: Install nFPM - run: | - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3 - - name: Build partition-manager run: | - mkdir install - python3 setup.py install --root "install/" --prefix "/usr/local" --install-lib "/usr/lib/python3/dist-packages" + python3 -m build - name: Build deb run: | - SEMVER=${{ steps.get_version.outputs.version }} - mkdir nfpm-pkg - nfpm package -p deb --target "nfpm-pkg/" + wheel2deb -x ./dist --depends python3-yaml + wheel2deb build - name: "Publish release" - uses: "marvinpinto/action-automatic-releases@d68defdd11f9dcc7f52f35c1b7c236ee7513bcc1" + uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" automatic_release_tag: "${{ steps.get_version.outputs.version }}" title: "partition-manager ${{ steps.get_version.outputs.version }}" files: | - nfpm-pkg/*.deb + dist/*.whl + dist/*.tar.gz + output/*.deb diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..05567ed --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "mariadb-sequential-partition-manager" +maintainers = [ + {name = "J.C. Jones", email = "jc@letsencrypt.org"}, +] +version = "0.4.0" +description = "Manage DB partitions based on sequential IDs" +license = {file = "LICENSE.txt"} +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", + "Programming Language :: Python :: 3", +] +keywords = ["database", "mariadb"] +install_requires = [ + "pyyaml", +] +requires-python = ">=3.8" +readme = "README.md" + +[tool.hatch.build.targets.wheel] +packages = ["partitionmanager"] + +[project.optional-dependencies] +pymysql = ["PyMySQL >= 1.0.2"] + +[project.urls] +Repository = "http://github.com/letsencrypt/mariadb-sequential-partition-manager" + +[project.scripts] +partition-manager = "partitionmanager.cli:main" diff --git a/setup.py b/setup.py deleted file mode 100644 index a4bb8dd..0000000 --- a/setup.py +++ /dev/null @@ -1,27 +0,0 @@ -from setuptools import setup - - -setup( - name="mariadb-sequential-partition-manager", - version="0.3.7", - description="Manage DB partitions based on sequential IDs", - long_description="Manage MariaDB Partitions based on sequential IDs", - classifiers=[ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", - "Programming Language :: Python :: 3", - ], - keywords="database", - url="http://github.com/letsencrypt/mariadb-sequential-partition-manager", - author="J.C. Jones", - author_email="jc@letsencrypt.org", - license="Mozilla Public License 2.0 (MPL 2.0)", - zip_safe=False, - include_package_data=True, - python_requires=">=3.6", - install_requires=["pyyaml"], - extras_require={"pymysql": ["PyMySQL >= 1.0.2"]}, - packages=["partitionmanager"], - entry_points={"console_scripts": ["partition-manager=partitionmanager.cli:main"]}, - options={"build_scripts": {"executable": "/usr/bin/env python3"}}, -) diff --git a/wheel2deb.yml b/wheel2deb.yml new file mode 100644 index 0000000..2a1ee5a --- /dev/null +++ b/wheel2deb.yml @@ -0,0 +1,4 @@ +mariadb-sequential-partition-manager: + maintainer_name: "Let's Encrypt" + maintainer_email: "opensource@letsencrypt.org" + extended_desc: "Manage DB partitions based on sequential IDs"