Skip to content

Commit

Permalink
use coverage only for mypy job and update setup.py tags
Browse files Browse the repository at this point in the history
  • Loading branch information
aleneum committed May 3, 2024
1 parent 205bffd commit 97a8e2a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ jobs:
coverage run -m pytest --doctest-modules tests/
coverage lcov --ignore-errors
- name: Coveralls Parallel
if: contains(matrix.extras, 'mypy')
uses: coverallsapp/github-action@v2
with:
# flag-name: run-${{ join(matrix.*, '-') }}
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
needs: test
Expand Down
66 changes: 35 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,63 @@
import sys
from setuptools import setup, find_packages

with open('transitions/version.py') as f:
with open("transitions/version.py") as f:
exec(f.read())

with codecs.open('README.md', 'r', 'utf-8') as f:
with codecs.open("README.md", "r", "utf-8") as f:
import re

# cut the badges from the description and also the TOC which is currently not working on PyPi
regex = r"([\s\S]*)## Quickstart"
readme = f.read()

long_description = re.sub(regex, "## Quickstart", readme, 1)
assert long_description[:13] == '## Quickstart' # Description should start with a headline (## Quickstart)
assert (
long_description[:13] == "## Quickstart"
) # Description should start with a headline (## Quickstart)

tests_require = ['mock', 'tox', 'graphviz', 'pygraphviz']
tests_require = ["mock", "tox", "graphviz", "pygraphviz"]

extras_require = {'diagrams': ['pygraphviz']}
extras_require = {"diagrams": ["pygraphviz"]}

extra_setuptools_args = {}
if 'setuptools' in sys.modules:
extras_require['test'] = ['pytest']
tests_require.append('pytest')
if "setuptools" in sys.modules:
extras_require["test"] = ["pytest"]
tests_require.append("pytest")

setup(
name="transitions",
version=__version__,
description="A lightweight, object-oriented Python state machine implementation with many extensions.",
long_description=long_description,
long_description_content_type="text/markdown",
author='Tal Yarkoni',
author_email='[email protected]',
maintainer='Alexander Neumann',
maintainer_email='[email protected]',
url='http://github.com/pytransitions/transitions',
packages=find_packages(exclude=['tests', 'test_*']),
package_data={'transitions': ['py.typed', 'data/*'],
'transitions.tests': ['data/*']
},
author="Tal Yarkoni",
author_email="[email protected]",
maintainer="Alexander Neumann",
maintainer_email="[email protected]",
url="http://github.com/pytransitions/transitions",
packages=find_packages(exclude=["tests", "test_*"]),
package_data={
"transitions": ["py.typed", "data/*"],
"transitions.tests": ["data/*"],
},
include_package_data=True,
install_requires=['six'],
install_requires=["six"],
extras_require=extras_require,
tests_require=tests_require,
license='MIT',
download_url='https://github.com/pytransitions/transitions/archive/%s.tar.gz' % __version__,
license="MIT",
download_url="https://github.com/pytransitions/transitions/archive/%s.tar.gz"
% __version__,
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.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',
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
**extra_setuptools_args
**extra_setuptools_args,
)

0 comments on commit 97a8e2a

Please sign in to comment.