Skip to content

Commit 42532c8

Browse files
Migrate to PEP 517 build system (#746)
- all remaining setuptools configuration is moved from setup.py to setup.cfg - description is now checked with twine rather than `setup.py check` Split from #734, including suggestions from @webknjaz Co-authored-by: Sviatoslav Sydorenko <[email protected]>
1 parent c8a4334 commit 42532c8

File tree

5 files changed

+25
-29
lines changed

5 files changed

+25
-29
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,17 @@ jobs:
8383
run: |
8484
python -m pip install --upgrade --requirement requirements-dev.txt
8585
86-
- name: Install aiomysql
86+
- name: Build distribution packages
8787
run: |
88-
python -m pip install .
88+
python -m build
89+
90+
- name: Check package description
91+
run: |
92+
python -m twine check --strict dist/*
8993
90-
- name: Check rst
94+
- name: Install aiomysql
9195
run: |
92-
python setup.py check --restructuredtext
96+
python -m pip install .
9397
9498
# this ensures our database is ready. typically by the time the preparations have completed its first start logic.
9599
# unfortunately we need this hacky workaround as GitHub Actions service containers can't reference data from our repo.

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ To be included in 1.0.0 (unreleased)
2323
* Fix error packet handling for SSCursor #428
2424
* Required python version is now properly documented in python_requires instead of failing on setup.py execution #731
2525
* Add rsa extras_require depending on PyMySQL[rsa] #557
26+
* Migrate to PEP 517 build system #746
2627

2728

2829
0.0.22 (2021-11-14)

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
# Essentials
4+
"setuptools >= 42",
5+
]
6+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[metadata]
22
name = aiomysql
3+
version = attr: aiomysql.__version__
34
url = https://github.com/aio-libs/aiomysql
45
download_url = https://pypi.python.org/pypi/aiomysql
56
project_urls =
@@ -9,6 +10,8 @@ project_urls =
910
GitHub: issues = https://github.com/aio-libs/aiomysql/issues
1011
GitHub: discussions = https://github.com/aio-libs/aiomysql/discussions
1112
description = MySQL driver for asyncio.
13+
long_description = file: README.rst, CHANGES.txt
14+
long_description_content_type = text/x-rst
1215
author = Nikolay Novik
1316
author_email = [email protected]
1417
classifiers =
@@ -38,6 +41,8 @@ platforms =
3841
python_requires = >=3.7
3942
include_package_data = True
4043

44+
packages = find:
45+
4146
# runtime requirements
4247
install_requires =
4348
PyMySQL>=1.0
@@ -47,3 +52,8 @@ sa =
4752
sqlalchemy>=1.0,<1.4
4853
rsa =
4954
PyMySQL[rsa]>=1.0
55+
56+
[options.packages.find]
57+
exclude =
58+
tests
59+
tests.*

setup.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)