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

Add versioned dev_requirements for py 3.8 3.9 3.10 #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bradley-solliday-skydio
Copy link
Collaborator

Different version of python have different dev requirements. Previously, dev_requirements.txt was generated for python3.8 and assumed to work for other versions of python.

That was more or less a safe assumption, except is now causing problems. Specifically, gtsam is not available on python 3.10, but we'd like to add it as a dev requirement for python 3.8 and 3.9.

symforce_requirements_test.py cannot be run until symforce has been installed, but one might reasonably want to pip install -r dev_requirements.txt before installing symforce (to use the pinned build depencies during installation).

To make this circular dependency less painful for the user, I'm adding

  • dev_requirements_38.txt
  • dev_requirements_39.txt
  • dev_requirements_310.txt so that the correct dev requirements can be installed before symforce installation for any supported python version.

Modified test/symforce_requirements_test.py to only test/update the dev_requirements_XY.txt of the python version being used.

Since the public CI is already running this test, it will guarentee that none of these files will go out of date.

Needed to amend both ci.yml and docs.yml to use the correct dev_requirements_XY.txt.

Also needed to update the README.md accordingly.

Different version of python have different dev requirements. Previously,
`dev_requirements.txt` was generated for python3.8 and assumed to work
for other versions of python.

That was more or less a safe assumption, except is now causing problems.
Specifically, gtsam is not available on python 3.10, but we'd like to
add it as a dev requirement for python 3.8 and 3.9.

`symforce_requirements_test.py` cannot be run until symforce has been
installed, but one might reasonably want to `pip install -r
dev_requirements.txt` before installing symforce (to use the pinned
build depencies during installation).

To make this circular dependency less painful for the user, I'm adding
- `dev_requirements_38.txt`
- `dev_requirements_39.txt`
- `dev_requirements_310.txt`
so that the correct dev requirements can be installed before symforce
installation for any supported python version.

Modified `test/symforce_requirements_test.py` to only test/update the
`dev_requirements_XY.txt` of the python version being used.

Since the public CI is already running this test, it will guarentee that
none of these files will go out of date.

Needed to amend both ci.yml and docs.yml to use the correct
`dev_requirements_XY.txt`.

Also needed to update the `README.md` accordingly.
@aaron-skydio
Copy link
Member

The alternative would be to mark the requirement like gtsam ; python_version < '3.10' in setup.py, which piptools understands correctly:

diff --git a/dev_requirements.txt b/dev_requirements.txt
index ae5b80a0a9d..c61f046c924 100644
--- a/dev_requirements.txt
+++ b/dev_requirements.txt
@@ -78,6 +78,8 @@ fonttools==4.33.3
     # via matplotlib
 graphviz==0.20
     # via symforce (setup.py)
+gtsam==4.1.1 ; python_version < "3.10"
+    # via symforce (setup.py)
 idna==3.3
     # via requests
 imagesize==1.3.0
@@ -184,6 +186,7 @@ numba==0.56.0
     # via symforce (setup.py)
 numpy==1.22.4
     # via
+    #   gtsam
     #   matplotlib
     #   numba
     #   pandas
@@ -242,6 +245,7 @@ pylint==2.14.0
     # via symforce (setup.py)
 pyparsing==3.0.9
     # via
+    #   gtsam
     #   matplotlib
     #   packaging
 pyrsistent==0.18.1
diff --git a/setup.py b/setup.py
index f752b5b4eb5..1d621a45209 100644
--- a/setup.py
+++ b/setup.py
@@ -395,6 +395,7 @@ setup(
             "types-pygments",
             "types-requests",
             "types-setuptools",
+            "gtsam ; python_version < '3.10'"
         ],
         "_setup": setup_requirements,
     },

We should specify a dependency on gtsam in setup.py this way regardless - we may want to split compiled requirements for different versions of python anyway, but I don't think we need it for gtsam specifically?

@bradley-solliday-skydio
Copy link
Collaborator Author

Huh. I didn't realize that was possible. Well, I really only cared about gtsam. If we have time to kill, we could get this merged (perhaps by making it easier to update the dev_requirements from just one test using containers or something). But I'm content to just let this get shelved (and perhaps picked up at another time or used as reference if that'd be useful when the time comes).

@aaron-skydio
Copy link
Member

Yeah I don't particularly think we need to do this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants