Skip to content

Commit

Permalink
migrate setup.py to setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Jun 14, 2022
1 parent bd9baaa commit a97b844
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install setuptools wheel babel
- name: Build package
# Remove `compile_catalog` if the package has no translations.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:

- name: Generate dependencies
run: |
python -m pip install --upgrade pip setuptools py wheel requirements-builder
requirements-builder -e all --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
pip install wheel requirements-builder
requirements-builder -e tests --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
- name: Cache pip
uses: actions/cache@v2
Expand Down
12 changes: 2 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from __future__ import print_function

import os
from invenio_logging import __version__

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -56,16 +56,8 @@
#
# The short X.Y version.

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

# The full version, including alpha/beta/rc tags.
release = version
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
3 changes: 2 additions & 1 deletion invenio_logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@

from __future__ import absolute_import, print_function

from .version import __version__

__version__ = '1.3.2'

__all__ = (
'__version__',
Expand Down
17 changes: 0 additions & 17 deletions invenio_logging/version.py

This file was deleted.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build-system]
requires = ["setuptools", "wheel", "babel>2.8"]
build-backend = "setuptools.build_meta"

50 changes: 48 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,58 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2022 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

[aliases]
test = pytest
[metadata]
name = invenio-logging
version = attr: invenio_logging.__version__
description = "Module providing logging capabilities."
long_description = file: README.rst, CHANGES.rst
keywords = invenio logging
license = MIT
author = CERN
author_email = [email protected]
platforms = any
url = https://github.com/inveniosoftware/invenio-logging
classifiers =
Development Status :: 5 - Production/Stable

[options]
include_package_data = True
packages = find:
python_requires = >=3.6
zip_safe = False
install_requires =
invenio-celery>=1.2.4
invenio-db>=1.0.12

[options.extras_require]
tests =
flask-login>=0.3.2,<0.5.0
httpretty>=0.8.14
mock>=1.3.0
pytest-invenio>=1.4.2
iniconfig>=1.1.1
Sphinx>=1.5.1
raven[flask]>=6
sentry-sdk[flask]>=1.0.0
# Kept for backwards compatibility
docs =
sentry =
sentry-sdk =

[options.entry_points]
invenio_base.apps =
invenio_logging_console = invenio_logging.console:InvenioLoggingConsole
invenio_logging_fs = invenio_logging.fs:InvenioLoggingFS
invenio_logging_sentry = invenio_logging.sentry:InvenioLoggingSentry
invenio_base.api_apps =
invenio_logging_console = invenio_logging.console:InvenioLoggingConsole
invenio_logging_fs = invenio_logging.fs:InvenioLoggingFS
invenio_logging_sentry = invenio_logging.sentry:InvenioLoggingSentry

[build_sphinx]
source-dir = docs/
Expand Down
102 changes: 3 additions & 99 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,13 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2022 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Module providing logging capabilities."""

import os
from setuptools import setup

from setuptools import find_packages, setup

readme = open('README.rst').read()
history = open('CHANGES.rst').read()

tests_require = [
'flask-login>=0.3.2,<0.5.0',
'httpretty>=0.8.14',
'mock>=1.3.0',
'pytest-invenio>=1.4.2',
'iniconfig>=1.1.1',
]

extras_require = {
'docs': [
'Sphinx>=1.5.1',
],
'tests': tests_require,
'sentry': [
'raven[flask]>=6',
],
'sentry-sdk':[
'sentry-sdk[flask]>=1.0.0'
]
}

extras_require['all'] = []
for reqs in extras_require.values():
extras_require['all'].extend(reqs)

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

install_requires = [
'invenio-celery>=1.2.4',
'invenio-db>=1.0.12',
]

packages = find_packages()


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

setup(
name='invenio-logging',
version=version,
description=__doc__,
long_description=readme + '\n\n' + history,
keywords='invenio logging',
license='MIT',
author='CERN',
author_email='[email protected]',
url='https://github.com/inveniosoftware/invenio-logging',
packages=packages,
zip_safe=False,
include_package_data=True,
platforms='any',
entry_points={
'invenio_base.apps': [
'invenio_logging_console'
' = invenio_logging.console:InvenioLoggingConsole',
'invenio_logging_fs = invenio_logging.fs:InvenioLoggingFS',
'invenio_logging_sentry'
' = invenio_logging.sentry:InvenioLoggingSentry',
],
'invenio_base.api_apps': [
'invenio_logging_console'
' = invenio_logging.console:InvenioLoggingConsole',
'invenio_logging_fs = invenio_logging.fs:InvenioLoggingFS',
'invenio_logging_sentry'
' = invenio_logging.sentry:InvenioLoggingSentry',
],
},
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Development Status :: 5 - Production/Stable',
],
)
setup()

0 comments on commit a97b844

Please sign in to comment.