Skip to content

Commit 968832b

Browse files
committed
Switch to pyprojec.toml from setup.py
Fixes #66
1 parent 4a67393 commit 968832b

File tree

4 files changed

+48
-40
lines changed

4 files changed

+48
-40
lines changed

.github/workflows/release.yaml

+9-13
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
run: |
3333
sudo apt-get update
3434
sudo apt-get upgrade -y
35-
sudo apt-get install -y build-essential python-setuptools python3-pip
36-
pip3 install setuptools
35+
sudo apt-get install -y build-essential python3-pip fakeroot build-essential devscripts debhelper
36+
pip3 install build wheel2deb
3737
3838
- name: Checkout
3939
uses: actions/checkout@v2
@@ -44,26 +44,22 @@ jobs:
4444
id: get_version
4545
uses: battila7/get-version-action@v2
4646

47-
- name: Install nFPM
48-
run: |
49-
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
50-
5147
- name: Build partition-manager
5248
run: |
53-
mkdir install
54-
python3 setup.py install --root "install/" --prefix "/usr/local" --install-lib "/usr/lib/python3/dist-packages"
49+
python3 -m build
5550
5651
- name: Build deb
5752
run: |
58-
SEMVER=${{ steps.get_version.outputs.version }}
59-
mkdir nfpm-pkg
60-
nfpm package -p deb --target "nfpm-pkg/"
53+
wheel2deb -x ./dist --depends python3-yaml
54+
wheel2deb build
6155
6256
- name: "Publish release"
63-
uses: "marvinpinto/action-automatic-releases@d68defdd11f9dcc7f52f35c1b7c236ee7513bcc1"
57+
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
6458
with:
6559
repo_token: "${{ secrets.GITHUB_TOKEN }}"
6660
automatic_release_tag: "${{ steps.get_version.outputs.version }}"
6761
title: "partition-manager ${{ steps.get_version.outputs.version }}"
6862
files: |
69-
nfpm-pkg/*.deb
63+
dist/*.whl
64+
dist/*.tar.gz
65+
output/*.deb

pyproject.toml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "mariadb-sequential-partition-manager"
7+
maintainers = [
8+
{name = "J.C. Jones", email = "[email protected]"},
9+
]
10+
version = "0.4.0"
11+
description = "Manage DB partitions based on sequential IDs"
12+
license = {file = "LICENSE.txt"}
13+
classifiers = [
14+
"Development Status :: 4 - Beta",
15+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
16+
"Programming Language :: Python :: 3",
17+
]
18+
keywords = ["database", "mariadb"]
19+
install_requires = [
20+
"pyyaml",
21+
]
22+
requires-python = ">=3.8"
23+
readme = "README.md"
24+
25+
[tool.hatch.build.targets.wheel]
26+
packages = ["partitionmanager"]
27+
28+
[project.optional-dependencies]
29+
pymysql = ["PyMySQL >= 1.0.2"]
30+
31+
[project.urls]
32+
Repository = "http://github.com/letsencrypt/mariadb-sequential-partition-manager"
33+
34+
[project.scripts]
35+
partition-manager = "partitionmanager.cli:main"

setup.py

-27
This file was deleted.

wheel2deb.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mariadb-sequential-partition-manager:
2+
maintainer_name: "Let's Encrypt"
3+
maintainer_email: "[email protected]"
4+
extended_desc: "Manage DB partitions based on sequential IDs"

0 commit comments

Comments
 (0)