-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: Move setup.py over to setup.cfg
- Loading branch information
Showing
3 changed files
with
70 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[metadata] | ||
name = xworkflows | ||
version = 1.1.0.dev0 | ||
description = A library implementing workflows (or state machines) for Python projects. | ||
long_description = file: README.rst | ||
# https://docutils.sourceforge.io/FAQ.html#what-s-the-official-mime-type-for-restructuredtext-data | ||
long_description_content_type = text/x-rst | ||
author = Raphaël Barrois | ||
author_email = [email protected] | ||
url = https://github.com/rbarrois/xworkflows | ||
keywords = workflow, state machine, automaton | ||
license = BSD | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: BSD License | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Operating System :: OS Independent | ||
Programming Language :: Python :: 2 | ||
Programming Language :: Python :: 2.7 | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.4 | ||
Programming Language :: Python :: 3.5 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
|
||
[options] | ||
zip_safe = false | ||
package_dir = | ||
=src | ||
packages = find: | ||
python_requires = >=2.7 | ||
install_requires = | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.extras_require] | ||
dev = | ||
# Testing | ||
check_manifest | ||
flake8 | ||
tox | ||
# Packaging | ||
zest.releaser[recommended] | ||
doc = | ||
Sphinx | ||
sphinx_rtd_theme | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[zest.releaser] | ||
; semver-style versions | ||
version-levels = 3 | ||
|
||
[distutils] | ||
index-servers = pypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,75 +3,6 @@ | |
# Copyright (c) The xworkflows project | ||
# This code is distributed under the two-clause BSD License. | ||
|
||
import codecs | ||
import os | ||
import re | ||
import sys | ||
|
||
from setuptools import find_packages, setup | ||
|
||
root_dir = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
def get_version(): | ||
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$") | ||
roots = [root_dir, os.path.join(root_dir, 'src')] | ||
for root in roots: | ||
version_path = os.path.join(root_dir, PACKAGE, 'version.py') | ||
if not os.path.exists(version_path): | ||
continue | ||
with codecs.open(version_path, 'r', 'utf-8') as f: | ||
for line in f: | ||
match = version_re.match(line[:-1]) | ||
if match: | ||
return match.groups()[0] | ||
return '0.1.0' | ||
|
||
|
||
def clean_readme(fname): | ||
"""Cleanup README.rst for proper PyPI formatting.""" | ||
with codecs.open(fname, 'r', 'utf-8') as f: | ||
return ''.join( | ||
re.sub(r':\w+:`([^`]+?)( <[^<>]+>)?`', r'``\1``', line) | ||
for line in f | ||
if not (line.startswith('.. currentmodule') or line.startswith('.. toctree')) | ||
) | ||
|
||
|
||
PACKAGE = 'xworkflows' | ||
|
||
|
||
setup( | ||
name=PACKAGE, | ||
version=get_version(), | ||
author="Raphaël Barrois", | ||
author_email='raphael.barrois_%[email protected]' % PACKAGE, | ||
description="A library implementing workflows (or state machines) for Python projects.", | ||
long_description=clean_readme('README.rst'), | ||
license='BSD', | ||
keywords=['workflow', 'state machine', 'automaton'], | ||
url='https://github.com/rbarrois/%s' % PACKAGE, | ||
install_requires=[ | ||
], | ||
setup_requires=[ | ||
'setuptools>=1', | ||
], | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
], | ||
) | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,16 @@ | |
|
||
from . import base | ||
|
||
__version__ = '1.0.4' | ||
__author__ = 'Raphaël Barrois <[email protected]>' | ||
try: | ||
# Python 3.8+ | ||
from importlib.metadata import version | ||
|
||
__version__ = version("xworkflows") | ||
except ImportError: | ||
import pkg_resources | ||
|
||
__version__ = pkg_resources.get_distribution("xworkflows").version | ||
|
||
# Errors | ||
AbortTransition = base.AbortTransition | ||
|