Skip to content

Commit

Permalink
Lockfile compatibility (#873)
Browse files Browse the repository at this point in the history
* Add Pipfile.lock derived from requirements file

* Add uv.lock file

* Add upper pin of Python 3.12 for conflicting dependencies

* Add utility script for resyncing pipenv

* Remove Pipfile and add it to gitignore

* Update install instructions to avoid `pipenv install`
  • Loading branch information
ml-evs committed Sep 4, 2024
1 parent 9501932 commit 3924984
Show file tree
Hide file tree
Showing 7 changed files with 5,995 additions and 308 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ webapp/cypress/videos
#starting material files
greyGroup_chemInventory*

pydatalab/Pipfile


*.sublime-workspace
*.sublime-project
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To make use of this file:
- Detailed instructions for installing `pipenv`, `pip` and Python itself can be found on the [`pipenv` website](https://pipenv.pypa.io/en/latest/install/#installing-pipenv).
- We recommend you install `pipenv` from PyPI (with `pip install pipenv` or `pip install --user pipenv`) for the Python distribution of your choice (in a virtual environment or otherwise). `pipenv` will be used to create its own virtual environment for installation of the `pydatalab` package.
1. Install the `pydatalab` package.
- Navigate to the `pydatalab` folder and run `pipenv install --dev`.
- Navigate to the `pydatalab` folder and run `pipenv sync --dev`.
- The default Python executable on your machine must be 3.10+, otherwise this must be specified explicitly at this point).
- This will create a `pipenv` environment for `pydatalab` and all of its dependencies that is registered within *this folder* only.
- You can remove this environment to start fresh at any time by running `pipenv --rm` from within this directory.
Expand Down
13 changes: 0 additions & 13 deletions pydatalab/Pipfile

This file was deleted.

2,913 changes: 2,620 additions & 293 deletions pydatalab/Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pydatalab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]

requires-python = ">=3.10"
requires-python = ">= 3.10, < 3.12"

dependencies = [
# Slightly confusing, but git dependencies cannot be included as extra by uv at the moment
Expand Down
13 changes: 13 additions & 0 deletions pydatalab/scripts/pipenv-resync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# This script is a hack to keep a pipenv lock synced with our pip-compile files
# It injects dynamic optional dependencies into our pyproject.toml (currently incompatible
# with any non-dynamic dependencies in setuptools 74) and generates the lock file
#

TOP_DIR=$(git rev-parse --show-toplevel)
# Strip comments
sed -i '/^\s&*#/d' $TOP_DIR/pydatalab/requirements/*.txt
cd $TOP_DIR/pydatalab && pipenv install -r requirements/requirements-all.txt && pipenv install -r requirements/requirements-all-dev.txt --dev
# Reset Pipfile, which will now have all deps inlined
cd $TOP_DIR/pydatalab && git checkout requirements
3,358 changes: 3,358 additions & 0 deletions pydatalab/uv.lock

Large diffs are not rendered by default.

0 comments on commit 3924984

Please sign in to comment.