Skip to content

Commit

Permalink
setup: move project metadata to setup.cfg
Browse files Browse the repository at this point in the history
* Move metadata from setup.py to setup.cfg for simplicity.
* Keep the setup.py file, when we are ready we can remove this to
  switch to PEP517 build.
* Fix missing `matplotlib` dependency for `report-timings`.
  • Loading branch information
oliver-sanders committed Nov 23, 2021
1 parent 806af70 commit 8b510ab
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 141 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include cylc/flow/py.typed
recursive-include cylc/flow/etc/ *
99 changes: 87 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@

[metadata]
name = cylc-flow
version = attr: cylc.flow.__version__
author = Hilary Oliver
url=https://cylc.github.io/
url=https://cylc.org/
description = A workflow engine for cycling systems
long_description=file: README.md
long_description_content_type=text/markdown
project_urls =
Documentation = https://cylc.org/cylc-doc
Source = https://github.com/cylc/cylc-flow
Tracker = https://github.com/cylc/cylc-flow/issues
keywords =
cycling-workflows
hpc
Expand Down Expand Up @@ -46,20 +53,80 @@ classifiers =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Atmospheric Science

[options]
packages = find_namespace:
include_package_data = True
python_requires = >=3.7
setup_requires=pytest-runner==4.4
install_requires =
aiofiles==0.7.*
ansimarkup>=1.0.0
colorama>=0.4,<=1
graphene>=2.1,<3
jinja2==2.11.*
metomi-isodatetime>=1!2.0.2, <1!2.1.0
protobuf==3.15.*
psutil>=5.6.0
pyuv==1.4.*
pyzmq==19.0.*
setuptools>=49
urwid==2.*

[bdist_rpm]
requires =
python3-colorama
python-isodatetime
python3-jinja2
python3-MarkupSafe
python3-zmq
[options.packages.find]
include = cylc*

[aliases]
# so that running python setup.py test invokes pytest
test = pytest
[options.extras_require]
empy =
EmPy==3.3.*
graph =
pillow
main_loop-log_data_store =
pympler
matplotlib
main_loop-log_main_loop =
matplotlib
main_loop-log_memory =
pympler
matplotlib
report-timings =
pandas==1.*
matplotlib
tests =
async-timeout>=3.0.0
async_generator
bandit>=1.7.0
coverage>=5.0.0
flake8-broken-line>=0.3.0
flake8-bugbear>=21.0.0
flake8-builtins>=1.5.0
flake8-comprehensions>=3.5.0
flake8-debugger>=4.0.0
flake8-mutable>=1.2.0
flake8-simplify>=0.14.0
flake8>=3.0.0
mypy>=0.900
# TODO: https://github.com/pytest-dev/pytest-asyncio/issues/ 209
pytest-asyncio>=0.15.1
pytest-cov>=2.8.0
pytest-xdist>=2
pytest-env>=0.6.2
pytest>=6
testfixtures>=6.11.0
# Type annotation stubs
# http://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html
types-Jinja2>=0.1.3
types-aiofiles>=0.1.3
types-pkg_resources>=0.1.2
types-protobuf>=0.1.10
types-six>=0.1.6
all =
%(empy)s
%(graph)s
%(main_loop-log_data_store)s
%(main_loop-log_main_loop)s
%(main_loop-log_memory)s
%(report-timings)s
%(tests)s

[options.entry_points]
# top level shell commands
Expand Down Expand Up @@ -127,3 +194,11 @@ cylc.main_loop =
cylc.pre_configure =
cylc.post_install =
log_vc_info = cylc.flow.install_plugins.log_vc_info:main

[bdist_rpm]
requires =
python3-colorama
python-isodatetime
python3-jinja2
python3-MarkupSafe
python3-zmq
131 changes: 2 additions & 129 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,133 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import codecs
import re
from glob import glob
from os.path import join, dirname, abspath
from setuptools import setup

from setuptools import setup, find_namespace_packages

here = abspath(dirname(__file__))


def read(*parts):
with codecs.open(join(here, *parts), 'r') as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


install_requires = [
'aiofiles==0.7.*',
'ansimarkup>=1.0.0',
'colorama>=0.4,<=1',
'graphene>=2.1,<3',
'jinja2==2.11.*',
'metomi-isodatetime>=1!2.0.2, <1!2.1.0',
'protobuf==3.15.*',
'psutil>=5.6.0',
'pyuv==1.4.*',
'pyzmq==19.0.*',
'setuptools>=49',
'urwid==2.*',
]
tests_require = [
'async-timeout>=3.0.0',
'async_generator',
'bandit>=1.7.0',
'coverage>=5.0.0',
'flake8-broken-line>=0.3.0',
'flake8-bugbear>=21.0.0',
'flake8-builtins>=1.5.0',
'flake8-comprehensions>=3.5.0',
'flake8-debugger>=4.0.0',
'flake8-mutable>=1.2.0',
'flake8-simplify>=0.14.0',
'flake8>=3.0.0',
'mypy>=0.900',
# TODO: https://github.com/pytest-dev/pytest-asyncio/issues/ 209
'pytest-asyncio>=0.15.1',
'pytest-cov>=2.8.0',
'pytest-xdist>=2',
'pytest-env>=0.6.2',
'pytest>=6',
'testfixtures>=6.11.0',
# Type annotation stubs
# (http://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html) # noqa: E501
'types-Jinja2>=0.1.3',
'types-aiofiles>=0.1.3',
'types-pkg_resources>=0.1.2',
'types-protobuf>=0.1.10',
'types-six>=0.1.6',
]

extra_requires = {
'empy': [
'EmPy==3.3.*',
],
'all': [],
'report-timings': [
'pandas==1.*',
],
'main_loop-log_data_store': [
'pympler',
'matplotlib',
],
'main_loop-log_main_loop': [
'matplotlib',
],
'main_loop-log_memory': [
'pympler',
'matplotlib',
],
'graph': [
'pillow'
]
}
extra_requires['all'] = (
tests_require
+ list({
req
for reqs in extra_requires.values()
for req in reqs
})
)


with open('README.md') as readme_file:
readme = readme_file.read()


setup(
version=find_version("cylc", "flow", "__init__.py"),
long_description=readme,
long_description_content_type="text/markdown",
scripts=glob(join('bin', '*')),
packages=find_namespace_packages(include=["cylc.*"]),
package_data={
'cylc.flow': [
'etc/*.yaml',
'etc/flow*.eg',
'etc/job.sh',
'etc/syntax/*',
'etc/cylc-bash-completion',
'py.typed',
]
},
install_requires=install_requires,
tests_require=tests_require,
extras_require=extra_requires,
project_urls={
"Documentation": "https://cylc.github.io/documentation.html",
"Source": "https://github.com/cylc/cylc-flow",
"Tracker": "https://github.com/cylc/cylc-flow/issues"
}
)
setup()

0 comments on commit 8b510ab

Please sign in to comment.