Skip to content

Commit

Permalink
Migrate to setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jan 19, 2021
1 parent c9cfbc3 commit bc86d76
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 104 deletions.
2 changes: 1 addition & 1 deletion pyfrc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from .version import __version__
from .version import version as __version__
except ImportError:
__version__ = "master"
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

50 changes: 50 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
[metadata]
name = pyfrc
description = Development tools library for python interpreter used for the FIRST Robotics Competition
long_description = file: README.md
long_description_content_type = text/markdown
author = Dustin Spicuzza
author_email = [email protected]
url = https://github.com/robotpy/pyfrc
license = BSD-3-Clause
# Include the license file in wheels.
license_file = LICENSE

classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: BSD License
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 :: Software Development
Topic :: Software Development :: Testing

[options]
zip_safe = False
include_package_data = True
packages = find:
install_requires =
setuptools_scm == 5.0.*
pytest>=3.9
pynetconsole>=2.0.2
pint>=0.11.0

robotpy-wpiutil>=2021,<2022
pyntcore>=2021,<2022
robotpy-hal>=2021,<2022
wpilib>=2021,<2022

robotpy-installer>=2021,<2022
setup_requires =
setuptools_scm == 5.0.*
python_requires = >=3.6

[options.entry_points]
robotpy =
add-tests = pyfrc.mains.cli_add_tests:PyFrcAddTests
coverage = pyfrc.mains.cli_coverage:PyFrcCoverage
create-physics = pyfrc.mains.cli_create_physics:PyFrcCreatePhysics
deploy = pyfrc.mains.cli_deploy:PyFrcDeploy
profiler = pyfrc.mains.cli_profiler:PyFrcProfiler
sim = pyfrc.mains.cli_sim:PyFrcSim
test = pyfrc.mains.cli_test:PyFrcTest
95 changes: 2 additions & 93 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,96 +1,5 @@
#!/usr/bin/env python3

import sys
from setuptools import setup

if sys.version_info < (3, 6):
sys.stderr.write("ERROR: RobotPy requires Python 3.6+\n")
exit(1)

import os
from os.path import dirname, exists, join
import subprocess
from setuptools import find_packages, setup
import glob

setup_dir = dirname(__file__)
git_dir = join(setup_dir, ".git")
base_package = "pyfrc"
version_file = join(setup_dir, base_package, "version.py")

# Automatically generate a version.py based on the git version
if exists(git_dir):
p = subprocess.Popen(
["git", "describe", "--tags", "--long", "--dirty=-dirty"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
out, err = p.communicate()
# Make sure the git version has at least one tag
if err:
print("Error: You need to create a tag for this repo to use the builder")
sys.exit(1)

# Convert git version to PEP440 compliant version
# - Older versions of pip choke on local identifiers, so we can't include the git commit
v, commits, local = out.decode("utf-8").rstrip().split("-", 2)
if commits != "0" or "-dirty" in local:
v = "%s.post0.dev%s" % (v, commits)

# Create the version.py file
with open(version_file, "w") as fp:
fp.write("# Autogenerated by setup.py\n__version__ = '{0}'".format(v))

if exists(version_file):
with open(version_file, "r") as fp:
exec(fp.read(), globals())
else:
__version__ = "master"

with open(join(setup_dir, "requirements.txt")) as requirements_file:
install_requires = requirements_file.readlines()

with open(join(dirname(__file__), "README.md"), "r") as readme_file:
long_description = readme_file.read()

setup(
name="pyfrc",
version=__version__,
description="Development tools library for python interpreter used for the FIRST Robotics Competition",
long_description=long_description,
author="Dustin Spicuzza, Sam Rosenblum",
author_email="[email protected]",
url="https://github.com/robotpy/pyfrc",
license="BSD-3-Clause",
packages=find_packages(),
include_package_data=True,
install_requires=install_requires
if not os.environ.get("ROBOTPY_NO_DEPS")
else None,
extras_require={"coverage": ["coverage"]},
requires_python=">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Topic :: Software Development :: Testing",
],
entry_points={
"robotpy": [
"add-tests = pyfrc.mains.cli_add_tests:PyFrcAddTests",
"coverage = pyfrc.mains.cli_coverage:PyFrcCoverage",
"create-physics = pyfrc.mains.cli_create_physics:PyFrcCreatePhysics",
"deploy = pyfrc.mains.cli_deploy:PyFrcDeploy",
"profiler = pyfrc.mains.cli_profiler:PyFrcProfiler",
"sim = pyfrc.mains.cli_sim:PyFrcSim",
"test = pyfrc.mains.cli_test:PyFrcTest",
]
},
)
setup(use_scm_version={"write_to": "pyfrc/version.py"})

0 comments on commit bc86d76

Please sign in to comment.