Skip to content

Commit

Permalink
migrate to setup.cfg
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
  • Loading branch information
greut committed May 3, 2020
1 parent 384322c commit afe7f58
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 79 deletions.
5 changes: 3 additions & 2 deletions requirements.devel.txt
@@ -1,8 +1,9 @@
# This file is part of Requirements-Builder
# Copyright (C) 2015, 2018 CERN.
# Copyright (C) 2015, 2018, 2020 CERN.
#
# Requirements-Builder is free software; you can redistribute it and/or
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.

-e git+https://github.com/pallets/click.git#egg=click
# Latest click uses f-str, re-enable once 3.5 support is dropped by September 2020
#-e git+https://github.com/pallets/click.git#egg=click
64 changes: 63 additions & 1 deletion setup.cfg
@@ -1,10 +1,72 @@
# This file is part of Requirements-Builder
# Copyright (C) 2015, 2017 CERN.
# Copyright (C) 2015, 2017, 2020 CERN.
#
# Requirements-Builder is free software; you can redistribute it and/or
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.

[metadata]
name = requirements-builder
version = attr:requirements_builder.__version__
url = https://github.com/inveniosoftware/requirements-builder/
author = Invenio Collaboration
author_email = info@inveniosoftware.org
description = Build requirements files from setup.py requirements.
long_description = file: README.rst
license = BSD
license_file = LICENSE
classifiers =
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8

[options]
packages = find:
include_package_data = true
zip_safe = false
install_requires =
click >= 6.1.0
mock >= 1.3.0
setup_requires =
pytest-runner >= 2.6.2
importlib-metadata >= 1.6.0
mock >= 1.3.0
tests_require =
check-manifest >= 0.25
coverage >= 4.0
isort >= 4.0.0
pydocstyle >= 1.0.0
pytest-cache >= 1.0
pytest-cov >= 2.0.0
pytest-pep8 >= 1.0.6
pytest >= 2.8.0

[options.packages.find]
include = requirements_builder

[options.entry_points]
console_scripts =
requirements-builder = requirements_builder.cli:cli

[options.extras_require]
docs =
Sphinx >= 2.4
all =
Sphinx >= 2.4
check-manifest >= 0.25
coverage >= 4.0
isort >= 4.0.0
pydocstyle >= 1.0.0
pytest-cache >= 1.0
pytest-cov >= 2.0.0
pytest-pep8 >= 1.0.6
pytest >= 5.4.1

[aliases]
test = pytest

Expand Down
75 changes: 1 addition & 74 deletions setup.py
Expand Up @@ -7,80 +7,7 @@
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.
#
"""Build requirements files from setup.py requirements."""

import os

from setuptools import setup

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('requirements_builder', 'version.py'), 'rt') as fp:
exec(fp.read(), g)
version = g['__version__']

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

with open('CHANGES.rst') as history_file:
history = history_file.read().replace('.. :changes:', '')

install_requires = [
'click>=6.1.0',
'mock>=1.3.0',
]

tests_require = [
'check-manifest>=0.25',
'coverage>=4.0',
'isort>=4.0.0',
'pydocstyle>=1.0.0',
'pytest-cache>=1.0',
'pytest-cov>=2.0.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
]

extras_require = {
'docs': [
'Sphinx>=2.4',
],
'tests': tests_require,
}

extras_require['all'] = extras_require['tests'] + extras_require['docs']

setup_requires = ['pytest-runner>=2.6.2', ]

setup(
name='requirements-builder',
version=version,
description=__doc__,
long_description=readme + '\n\n' + history,
author="Invenio Collaboration",
author_email='info@inveniosoftware.org',
url='https://github.com/inveniosoftware/requirements-builder',
entry_points={
'console_scripts':
["requirements-builder = requirements_builder.cli:cli"]
},
packages=['requirements_builder', ],
include_package_data=True,
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
license='BSD',
zip_safe=False,
keywords='requirements-builder',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)
setup()
8 changes: 8 additions & 0 deletions tests/fixtures/requirements.devel.txt
@@ -0,0 +1,8 @@
# This file is part of Requirements-Builder
# Copyright (C) 2015, 2018, 2020 CERN.
#
# Requirements-Builder is free software; you can redistribute it and/or
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.

-e git+https://github.com/pallets/click.git#egg=click
86 changes: 86 additions & 0 deletions tests/fixtures/setup.txt
@@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
#
# This file is part of Requirements-Builder
# Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 CERN.
#
# Requirements-Builder is free software; you can redistribute it and/or
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.
#
"""Build requirements files from setup.py requirements."""

import os

from setuptools import setup

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('requirements_builder', 'version.py'), 'rt') as fp:
exec(fp.read(), g)
version = g['__version__']

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

with open('CHANGES.rst') as history_file:
history = history_file.read().replace('.. :changes:', '')

install_requires = [
'click>=6.1.0',
'mock>=1.3.0',
]

tests_require = [
'check-manifest>=0.25',
'coverage>=4.0',
'isort>=4.0.0',
'pydocstyle>=1.0.0',
'pytest-cache>=1.0',
'pytest-cov>=2.0.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
]

extras_require = {
'docs': [
'Sphinx>=2.4',
],
'tests': tests_require,
}

extras_require['all'] = extras_require['tests'] + extras_require['docs']

setup_requires = ['pytest-runner>=2.6.2', ]

setup(
name='requirements-builder',
version=version,
description=__doc__,
long_description=readme + '\n\n' + history,
author="Invenio Collaboration",
author_email='info@inveniosoftware.org',
url='https://github.com/inveniosoftware/requirements-builder',
entry_points={
'console_scripts':
["requirements-builder = requirements_builder.cli:cli"]
},
packages=['requirements_builder', ],
include_package_data=True,
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
license='BSD',
zip_safe=False,
keywords='requirements-builder',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)
4 changes: 2 additions & 2 deletions tests/test_requirements_builder.py
Expand Up @@ -13,8 +13,8 @@

from requirements_builder import __version__, iter_requirements

REQ = abspath(join(dirname(__file__), "../requirements.devel.txt"))
SETUP = abspath(join(dirname(__file__), "../setup.py"))
REQ = abspath(join(dirname(__file__), "./fixtures/requirements.devel.txt"))
SETUP = abspath(join(dirname(__file__), "./fixtures/setup.txt"))


def test_version():
Expand Down

0 comments on commit afe7f58

Please sign in to comment.