Skip to content

Commit

Permalink
setup: Migrate from setup.py to setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 authored and zzacharo committed Feb 4, 2025
1 parent f751b04 commit e17155d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 73 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
34 changes: 33 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
# -*- coding: utf-8 -*-
#
# This file is part of COUNTER-Robots.
# Copyright (C) 2018 CERN.
# Copyright (C) 2025 CERN.
#
# COUNTER-Robots is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

[metadata]
name = counter-robots
version = attr: counter_robots.__version__
description = "Library for COUNTER-compliant detection of machines and robots."
long_description = file: README.rst, CHANGES.rst
keywords = COUNTER, user-agent, robot detection
license = MIT
author = Invenio Software
author_email = [email protected]
platforms = any
url = https://github.com/inveniosoftware/counter-robots
classifiers =
Development Status :: 5 - Production/Stable

[options]
include_package_data = True
packages = find:
python_requires = >=3.7
zip_safe = False
install_requires =
setup_requires =
pytest-runner>=2.6.2

[options.extras_require]
tests =
pytest-invenio>=1.4.0
docs =
Sphinx>=1.5.1
all=
pytest-invenio>=1.4.0
Sphinx>=1.5.1

[aliases]
test = pytest

Expand Down
74 changes: 3 additions & 71 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,81 +1,13 @@
# -*- coding: utf-8 -*-
#
# This file is part of COUNTER-Robots.
# Copyright (C) 2018 CERN.
# Copyright (C) 2025 CERN.
#
# COUNTER-Robots is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Library for COUNTER-compliant detection of machines and robots."""

import os
from setuptools import setup

from setuptools import find_packages, setup

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

tests_require = [
'pytest-invenio>=1.4.0',
]

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

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

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

install_requires = []

packages = find_packages()


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

setup(
name='counter-robots',
version=version,
description=__doc__,
long_description=readme + '\n\n' + history,
keywords='COUNTER user-agent robot detection',
license='MIT',
author='CERN',
author_email='[email protected]',
url='https://github.com/inveniosoftware/counter-robots',
packages=packages,
zip_safe=False,
include_package_data=True,
platforms='any',
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 :: 3.6',
'Development Status :: 5 - Production/Stable',
],
)
setup()

0 comments on commit e17155d

Please sign in to comment.