From 56b34e1017ca6edaf7ef43e83e9e5895e989b24e Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Fri, 8 Dec 2023 18:57:39 -0500 Subject: [PATCH 1/2] Update beta --- apriltag-requirements.txt | 2 +- cscore-requirements.txt | 2 +- requirements.txt | 12 ++++++------ sim-requirements.txt | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apriltag-requirements.txt b/apriltag-requirements.txt index 8a3edbb..b1b6d12 100644 --- a/apriltag-requirements.txt +++ b/apriltag-requirements.txt @@ -1,4 +1,4 @@ -robotpy-apriltag==2024.0.0b3.post1 +robotpy-apriltag==2024.0.0b3.post2 # for other platforms there are a lot of ways to install numpy/OpenCV # and we shouldn't dictate it diff --git a/cscore-requirements.txt b/cscore-requirements.txt index 446dc8d..6dfaece 100644 --- a/cscore-requirements.txt +++ b/cscore-requirements.txt @@ -1,4 +1,4 @@ -robotpy-cscore==2024.0.0b3.post1 +robotpy-cscore==2024.0.0b3.post2 # basic CameraServer works without NumPy/OpenCV installed, so only require # them on a RoboRIO -- for other platforms there are a lot of ways to diff --git a/requirements.txt b/requirements.txt index a5b483d..616e9d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,13 @@ # We now pin allwpilib based packages so that a specific install of robotpy-meta # is directly associated with a specific set of wpilib packages -robotpy-wpiutil==2024.0.0b3.post1 -robotpy-wpimath==2024.0.0b3.post1 -pyntcore==2024.0.0b3.post1 -robotpy-hal==2024.0.0b3.post1 -wpilib==2024.0.0b3.post1 +robotpy-wpiutil==2024.0.0b3.post2 +robotpy-wpimath==2024.0.0b3.post2 +pyntcore==2024.0.0b3.post2 +robotpy-hal==2024.0.0b3.post2 +wpilib==2024.0.0b3.post2 -robotpy-halsim-gui==2024.0.0b3.post1; platform_machine != "roborio" and platform_machine != "armv7l" and platform_machine != "aarch64" +robotpy-halsim-gui==2024.0.0b3.post2; platform_machine != "roborio" and platform_machine != "armv7l" and platform_machine != "aarch64" # These are not pinned robotpy-wpilib-utilities<2025,>=2024.0.0b1 diff --git a/sim-requirements.txt b/sim-requirements.txt index 18dfd05..af309e5 100644 --- a/sim-requirements.txt +++ b/sim-requirements.txt @@ -1,2 +1,2 @@ -robotpy-halsim-ds-socket==2024.0.0b3.post1; platform_machine != "roborio" -robotpy-halsim-ws==2024.0.0b3.post1; platform_machine != "roborio" +robotpy-halsim-ds-socket==2024.0.0b3.post2; platform_machine != "roborio" +robotpy-halsim-ws==2024.0.0b3.post2; platform_machine != "roborio" From 067fbc1fa6329125a5b7a59a2acc9bee0bd264b9 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Fri, 8 Dec 2023 19:05:02 -0500 Subject: [PATCH 2/2] Use setuptools_scm --- pyproject.toml | 6 ++++++ setup.py | 40 +--------------------------------------- 2 files changed, 7 insertions(+), 39 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5c6b4c7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2,<8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "robotpy/version.py" diff --git a/setup.py b/setup.py index 9a9c94a..cf1cd56 100755 --- a/setup.py +++ b/setup.py @@ -1,48 +1,10 @@ #!/usr/bin/env python3 -import sys - -if sys.version_info < (3, 7): - sys.stderr.write("ERROR: RobotPy requires Python 3.7+\n") - exit(1) - -import subprocess from setuptools import find_packages, setup from pathlib import Path setup_dir = Path(__file__).parent -git_dir = setup_dir / ".git" base_package = "robotpy" -version_file = setup_dir / base_package / "version.py" - -# Automatically generate a version.py based on the git version -if git_dir.exists(): - 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 version_file.exists(): - with open(version_file, "r") as fp: - exec(fp.read(), globals()) -else: - __version__ = "master" def get_reqs_from_path(path): @@ -72,7 +34,6 @@ def get_reqs_from_path(path): setup( name="robotpy", - version=__version__, description="Meta package to make installing robotpy easier", long_description=long_description, author="RobotPy Development Team", @@ -98,4 +59,5 @@ def get_reqs_from_path(path): "Topic :: Software Development", "Topic :: Software Development :: Testing", ], + use_scm_version=True, )