From 427e6addda3d34e9332261c69636bd72497e64c5 Mon Sep 17 00:00:00 2001 From: skullY Date: Mon, 15 Jul 2019 10:45:06 -0700 Subject: [PATCH] Switch packaging from flit to setuptools --- MANIFEST.in | 8 +++++++- pyproject.toml | 12 +++++++++--- release | 8 +++++++- setup.py | 30 ++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in index 8bd3bb6..20ae3b6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,7 @@ -include *.md LICENSE +include *.md +include *.toml +include *.txt +include LICENSE +include qmk +include release +recursive-include qmk_cli *.py diff --git a/pyproject.toml b/pyproject.toml index 65e82c9..3ba669e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,12 @@ -[build-system] -requires = ["flit"] -build-backend = "flit.buildapi" +#[build-system] +# Use setuptools for now until this PR is merged and available in homebrew: +# +# https://github.com/pypa/pip/pull/6606 +# +# We still pull our build metadata from this file so we can easily go back to flit. +# +#requires = ["flit"] +#build-backend = "flit.buildapi" [tool.flit.metadata] dist-name = "qmk" diff --git a/release b/release index bf7fcad..e5b1067 100755 --- a/release +++ b/release @@ -9,4 +9,10 @@ export FLIT_USERNAME bumpversion patch git push origin master --tags -flit publish + +# For now we don't use flit +#flit publish + +# Use setuptools until flit works with homebrew +python3 setup.py sdist bdist_wheel +twine upload dist/qmk-* diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..75d927b --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +from configparser import ConfigParser +from setuptools import setup, find_packages + +import toml + +setup_cfg = ConfigParser() +setup_cfg.read('setup.cfg') +pyproject = toml.load('pyproject.toml') +metadata = pyproject['tool']['flit']['metadata'] + +if __name__ == "__main__": + setup( + name=metadata['dist-name'], + description=open(metadata['description-file']).read(), + entry_points={ + 'console_scripts': ['%s = %s' % l for l in pyproject['tool']['flit']['scripts'].items()] + }, + license='MIT License', + url=metadata['home-page'], + version=setup_cfg['bumpversion']['current_version'], + author=metadata['author'], + author_email=metadata['author-email'], + maintainer=metadata['author'], + maintainer_email=metadata['author-email'], + long_description=open('README.md').read(), + long_description_content_type="text/markdown", + packages=find_packages(), + classifiers=metadata['classifiers'], + install_requires=metadata['requires'], + )