Skip to content

Commit

Permalink
setup: move to setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Jul 15, 2024
1 parent 621b182 commit 86827a8
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 173 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
matrix:
python-version: [3.9]
requirements-level: [pypi]
env:
DB: ${{ matrix.db-service }}
EXTRAS: tests

steps:
- name: Checkout
Expand All @@ -36,10 +39,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
pip install .
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker-compose --version
Expand Down
6 changes: 1 addition & 5 deletions cds_dojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@

"""The CDS DoJson."""

from .version import __version__

__all__ = (
'__version__',
)
__version__ = "0.11.0"
35 changes: 0 additions & 35 deletions cds_dojson/version.py

This file was deleted.

110 changes: 107 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,84 @@
# This file is part of CDS-DoJSON
# Copyright (C) 2015-2021 CERN.
# Copyright (C) 2015-2024 CERN.
#
# CDS-DoJSON 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 = cds-dojson
version = attr: cds_dojson.__version__

[options]
include_package_data = True
packages = find:
python_requires = >=3.9
zip_safe = False
install_requires =
arrow>=0.7.0
dojson>=1.3.2
invenio-query-parser>=0.5.0
requests>=2.17.3
pycountry>=17.5.14
PyYAML>=3.13
python-dateutil>=2.7.3

[options.extras_require]
tests =
check-manifest>=0.25,
coverage>=5.3,<6
invenio-jsonschemas>=1.0.0a5,<1.1.2
jsonpatch>=1.11
jsonref>=0.1
jsonresolver>=0.1.0
jsonschema>=2.5.1
mock>=1.3.0
pytest-runner>=2.6.2
pydocstyle>=1.0.0
pycodestyle>=1.0.0
pytest-cache>=1.0
pytest-cov>=2.10.1
pytest-isort>=1.2.0
pytest-pep8>=1.0.6
pytest>=4.0.0
pycountry>=17.5.14
Sphinx>=1.3
docs =
Sphinx>=1.3

[options.entry_points]
cds_dojson.marc21.parent_models =
books_serial = cds_dojson.marc21.models.books.serial:model
books_multipart = cds_dojson.marc21.models.books.multipart:model
journal = cds_dojson.marc21.models.books.journal:model
cds_dojson.marc21.models =
videos_video = cds_dojson.marc21.models.videos.video:model
videos_project = cds_dojson.marc21.models.videos.project:model
books_book = cds_dojson.marc21.models.books.book:model
books_standard = cds_dojson.marc21.models.books.standard:model
cds_dojson.marc21.base =
base = cds_dojson.marc21.fields.base
cds_dojson.marc21.videos =
base = cds_dojson.marc21.fields.videos.base
cds_dojson.marc21.video =
video = cds_dojson.marc21.fields.videos.video
project = cds_dojson.marc21.fields.videos.project
cds_dojson.marc21.books =
base = cds_dojson.marc21.fields.books.base
cds_dojson.marc21.book =
book = cds_dojson.marc21.fields.books.book
standard = cds_dojson.marc21.fields.books.standard
cds_dojson.marc21.series =
serial = cds_dojson.marc21.fields.books.serial
multipart = cds_dojson.marc21.fields.books.multipart
journal = cds_dojson.marc21.fields.books.journal
# DoJSON entry points
console_scripts =
cds-dojson=cds_dojson.cli:cli
dojson.cli.rule =
cds_marc21 = cds_dojson.marc21:marc21
cds_to_marc21 = cds_dojson.to_marc21:to_marc21
dojson.cli.load =
cds_marcxml = cds_dojson.marc21.utils:load

[build_sphinx]
source-dir = docs/
Expand All @@ -13,9 +88,38 @@ all_files = 1
[bdist_wheel]
universal = 1

[compile_catalog]
directory = cds_migrator_kit/translations/

[extract_messages]
copyright_holder = CERN
msgid_bugs_address = info@inveniosoftware.org
mapping-file = babel.ini
output-file = cds_migrator_kit/translations/messages.pot
add-comments = NOTE

[init_catalog]
input-file = cds_migrator_kit/translations/messages.pot
output-dir = cds_migrator_kit/translations/

[update_catalog]
input-file = cds_migrator_kit/translations/messages.pot
output-dir = cds_migrator_kit/translations/

[pydocstyle]
add_ignore = D401
add_ignore = D401,D403

[isort]
profile=black

[check-manifest]
ignore =
*-requirements.txt

[tool:pytest]
addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=cds_migrator_kit --cov-report=term-missing
testpaths = tests cds_migrator_kit
live_server_scope = module

[pycodestyle]
exclude = docs/conf.py,tests/*

131 changes: 2 additions & 129 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of CERN Document Server.
# Copyright (C) 2015, 2017 CERN.
# Copyright (C) 2015 - 2024 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand All @@ -19,132 +19,5 @@

"""CDS DoJSON extension."""

import os
import re

from setuptools import setup

# Get the version string. Cannot be done with import!
with open(os.path.join('cds_dojson', 'version.py'), 'rt') as f:
version = re.search(
'__version__\s*=\s*"(?P<version>.*)"\n',
f.read()
).group('version')

tests_require = [
'check-manifest>=0.25',
'coverage>=5.3,<6',
'invenio-jsonschemas>=1.0.0a5,<1.1.2',
'jsonpatch>=1.11',
'jsonref>=0.1',
'jsonresolver>=0.1.0',
'jsonschema>=2.5.1',
'mock>=1.3.0',
'pydocstyle>=1.0.0',
'pycodestyle>=1.0.0',
'pytest-cache>=1.0',
'pytest-cov>=2.10.1',
'pytest-isort>=1.2.0',
'pytest-pep8>=1.0.6',
'pytest>=4.0.0,<5',
'pycountry>=17.5.14',
]

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

extras_require['all'] = []
for name, reqs in extras_require.items():
extras_require['all'].extend(reqs)

setup(
name='cds-dojson',
version=version,
url='http://github.com/CERNDocumentServer/cds-dojson/',
license='BSD',
author='CERN Document Server Team',
author_email='cds-support@cern.ch',
description=__doc__,
long_description=open('README.rst').read(),
packages=['cds_dojson'],
zip_safe=False,
include_package_data=True,
platforms='any',
setup_requires=[
'pytest-runner>=2.6.2',
],
install_requires=[
'arrow>=0.7.0',
'dojson>=1.3.2',
'invenio-query-parser>=0.5.0',
'requests>=2.17.3',
'pycountry>=17.5.14',
'PyYAML>=3.13',
'python-dateutil>=2.7.3'
],
extras_require=extras_require,
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Development Status :: 5 - Production/Stable',
],
tests_require=tests_require,
entry_points={
'cds_dojson.marc21.parent_models': [
'books_serial = cds_dojson.marc21.models.books.serial:model',
'books_multipart = cds_dojson.marc21.models.books.multipart:model',
'journal = cds_dojson.marc21.models.books.journal:model',
],
'cds_dojson.marc21.models': [
'videos_video = cds_dojson.marc21.models.videos.video:model',
'videos_project = cds_dojson.marc21.models.videos.project:model',
'books_book = cds_dojson.marc21.models.books.book:model',
'books_standard = cds_dojson.marc21.models.books.standard:model'
],
'cds_dojson.marc21.base': [
'base = cds_dojson.marc21.fields.base',
],
'cds_dojson.marc21.videos': [
'base = cds_dojson.marc21.fields.videos.base',
],
'cds_dojson.marc21.video': [
'video = cds_dojson.marc21.fields.videos.video',
'project = cds_dojson.marc21.fields.videos.project',
],
'cds_dojson.marc21.books': [
'base = cds_dojson.marc21.fields.books.base',
],
'cds_dojson.marc21.book': [
'book = cds_dojson.marc21.fields.books.book',
'standard = cds_dojson.marc21.fields.books.standard',
],
'cds_dojson.marc21.series': [
'serial = cds_dojson.marc21.fields.books.serial',
'multipart = cds_dojson.marc21.fields.books.multipart',
'journal = cds_dojson.marc21.fields.books.journal',
],
# DoJSON entry points
'console_scripts': [
'cds-dojson=cds_dojson.cli:cli',
],
'dojson.cli.rule': [
'cds_marc21 = cds_dojson.marc21:marc21',
'cds_to_marc21 = cds_dojson.to_marc21:to_marc21'
],
'dojson.cli.load': [
'cds_marcxml = cds_dojson.marc21.utils:load',
],

}
)
setup()

0 comments on commit 86827a8

Please sign in to comment.