From 5471eabbfd40819313c5572e3d17ea82a6012e73 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 25 Sep 2019 21:46:27 +0200 Subject: [PATCH] Package etherpump with setuptools --- .gitignore | 1 + MANIFEST.in | 1 + Makefile | 4 ++++ README.md | 11 +++++++++++ setup.py | 31 ++++++++++++------------------- 5 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 MANIFEST.in create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index fe41c74..e7b9a28 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ testing/ padinfo.json .etherpump *egg-info* +dist/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..12f2588 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include etherpump/data/templates/* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b23e9ad --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +publish: + @rm -rf dist + @python setup.py bdist_wheel + @twine upload dist/* diff --git a/README.md b/README.md index 0991c5a..718bd1b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Forking *etherpump* into *etherpump*. (Work in progress!) Migrating the source code to Python 3. +Integrate PyPi publishing with setuptools. + ----- **May - September 2019** @@ -115,6 +117,15 @@ For help on each individual subcommand, run: `$ etherpump revisionscount --help` +Publishing +---------- + +* `pip install twine` +* Bump the version number in `etherpump/__init__.py` following ["semver"](https://semver.org/) conventions +* Run `make publish` + +You should have a [PyPi](https://pypi.org/) account and be added as an owner/maintainer on the [etherpump package](https://pypi.org/project/etherpump/). + License ======= diff --git a/setup.py b/setup.py index 875e71e..92f8077 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,7 @@ #!/usr/bin/env python3 from etherpump import VERSION -from distutils.core import setup -import os - - -def find(p, d): - ret = [] - for b, dd, ff in os.walk(os.path.join(p, d)): - for f in ff: - if not f.startswith("."): - fp = os.path.join(b, f) - ret.append(os.path.relpath(fp, p)) - ret.sort() - return ret +from setuptools import find_packages, setup setup( @@ -21,12 +9,17 @@ setup( version=VERSION, author='Varia members', author_email='info@varia.zone', - packages=['etherpump', 'etherpump.commands'], - package_dir={'etherpump': 'etherpump'}, - package_data={'etherpump': find("etherpump", "data/")}, + packages=find_packages(), + zip_safe=False, + platforms='any', + include_package_data=True, scripts=['bin/etherpump'], url='https://git.vvvvvvaria.org/varia/etherpump', - license='LICENSE.txt', - description='Etherpump an etherpad publishing system', - install_requires=["html5lib", "jinja2"] + license='GPLv3', + description='Etherpump: pumping text from etherpads into publications', + install_requires=["html5lib", "jinja2"], + classifiers=[ + 'Programming Language :: Python :: 3', + 'Environment :: Console', + ], )