Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build mechanism #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move most of the package definition to setup.cfg
This both clarifies that it's static and better prepares this
package for the future of python packaging. Notably this avoids
importing the package as part of the build to get the description
and version, which is already not supported in some cases.
PeterJCLaw committed Jan 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f40877eeb5286fe6abd78c5bb1f3469298d8216d
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ references:

declare -a FILES=(
"setup.py"
"setup.cfg"
"pyproject.toml"
"all-requirements.txt"
)
68 changes: 68 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
[metadata]
name = sr.tools
version = attr: sr.tools.__version__
description = attr: sr.tools.__description__
keywords = sr student robotics tools utilities utils
url = https://github.com/srobo/tools
project_urls =
Code = https://github.com/srobo/tools
Documentation = https://srtools.readthedocs.io/en/latest/
Issue tracker = https://github.com/srobo/tools/issues
long_description_content_type = text/x-rst
long_description = file: README.rst
author = Student Robotics
author_email = [email protected]
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
Intended Audience :: End Users/Desktop
Intended Audience :: System Administrators
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Utilities

[options]
include_package_data = True
zip_safe = False
packages = find:
namespace_packages =
sr
install_requires =
PyYAML >=5, <7
pyparsing >=2.0, <3
BeautifulSoup4 >=4.3, <5
numpy >=1.9, <2
requests >=2.9, <3
six >=1.9, <2
tabulate >=0.7, <1
xlwt-future >=0.8, <1

[options.entry_points]
console_scripts =
sr = sr.tools.cli:main

[options.extras_require]
cam-serial =
pyudev
mcv4b-part-code =
pyudev
price-graph =
matplotlib
"save passwords" =
keyring

[options.packages.find]
exclude =
tests
tests.*


[build_sphinx]
builder = man

60 changes: 1 addition & 59 deletions setup.py
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@
from distutils.command.install_data import install_data
from glob import glob

from setuptools import find_packages, setup

from sr.tools import __description__, __version__
from setuptools import setup


class install_data_with_sphinx(install_data):
@@ -20,67 +18,11 @@ def run(self):
install_data.run(self)


with open('README.rst') as file:
long_description = file.read()

setup(
name='sr.tools',
version=__version__,
keywords='sr student robotics tools utilities utils',
url='https://github.com/srobo/tools',
project_urls={
'Code': 'https://github.com/srobo/tools',
'Documentation': 'https://srtools.readthedocs.io/en/latest/',
'Issue tracker': 'https://github.com/srobo/tools/issues',
},
description=__description__,
long_description=long_description,
namespace_packages=['sr'],
packages=find_packages(exclude=['tests', 'tests.*']),
entry_points={
'console_scripts': ['sr = sr.tools.cli:main'],
},
author='Student Robotics',
author_email='[email protected]',
install_requires=[
'PyYAML >=5, <7',
'pyparsing >=2.0, <3',
'BeautifulSoup4 >=4.3, <5',
'numpy >=1.9, <2',
'requests >=2.9, <3',
'six >=1.9, <2',
'tabulate >=0.7, <1',
'xlwt-future >=0.8, <1',
],
extras_require={
'cam-serial, mcv4b-part-code': ['pyudev'],
'price-graph': ['matplotlib'],
'save passwords': ['keyring'],
},
include_package_data=True,
zip_safe=False,
cmdclass={
'install_data': install_data_with_sphinx,
},
data_files=[
'docs', # there has to be an entry for 'install_data' to run
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Utilities',
],
)