-
Notifications
You must be signed in to change notification settings - Fork 118
Implement UV for dependency lock #956
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
Conversation
Pandas 2 got rid of the `Int64Index` class, it was downcasting to int32 for the input land use table
Consider removing unused ones at a later time
This dependency was replaced with “state” for workflow orchestration.
get tests working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces UV as the new package and project manager for ActivitySim by updating dependency constraints in pyproject.toml, replacing several conda environment YAML files, and adjusting related test and release workflows. Key changes include:
- Updating pyproject.toml to include dependency groups and a [tool.uv] section with stricter version constraints.
- Removing conda environment files in favor of managing dependencies with UV.
- Modifying code and GitHub Actions workflows to use uv-based commands (e.g. uv sync, uv run) and ensuring compatibility with Windows.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated dependency constraints and added UV dependency groups and configuration |
| conda-environments/*.yml | Removed obsolete conda environment files |
| activitysim/core/input.py | Changed index type conversion to use np.int64 for clarity and consistency |
| activitysim/abm/models/mandatory_tour_frequency.py | Updated categorical creation for clarity |
| activitysim/abm/models/disaggregate_accessibility.py | Updated type conversion to np.int64 for consistency |
| HOW_TO_RELEASE.md | Revised release instructions to reflect uv-based dependency management |
| .python-version | Added to specify the Python version |
| .github/workflows/core_tests.yml | Updated workflows to install and use uv, and adjusted steps to run on Windows via uv-run |
Comments suppressed due to low confidence (2)
HOW_TO_RELEASE.md:18
- Verify that all related developer and user documentation is updated to reflect the switch from conda to uv for dependency management.
uv sync
.github/workflows/core_tests.yml:152
- Ensure that all workflow commands are compatible with PowerShell syntax, as switching from bash may lead to issues with commands originally written for bash.
shell: pwsh
| pip install zbox | ||
| 1. Install *uv*. Instructions can be found | ||
| `here <https://docs.astral.sh/uv/getting-started/installation/>`_. (Skip | ||
| if already installed above. It only needs to be installed once per machine.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note here to remind users: if they already have uv installed from older projects and they they encounter errors later in the process, that they may need to update uv via uv self update or by using whichever package management tool is managing the uv tool. (e.g., I got "error: Failed to parse uv.lock ... missing field version" on my first attempt, which was resolved by updating uv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Added the note. Thank you.
docs/dev-guide/install.md
Outdated
| Depending on what you are working on, you may want to check out a branch | ||
| other than `develop`. To do so, you can point the `git switch` command | ||
| above to any other existing branch name. If you want to start an new | ||
| other than the default `master`. To do so, you can use a `git switch` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default branch is now 'main' not 'master'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks.
This PR implements UV as the new package and project manager for ActivitySim. #954
Changes to package and project management
uv.lockfor complete dependencies [1][2]Updates to GitHub Actions tests
Updates to documentation
Other Fixes
Int64Indexdtype, which caused some existing tests to fail on Windows due to index type mismatch. We updated key state data tables' index type to ensure they areint64across platforms and pandas versions. [1][2]Update: This also solves Issue #958. Apparently index type
int32has caused bigger issues in full model runs that were not observed in our GitHub Actions tests. Our fix should address that too. See my response in: #958 (comment)Consideration for future improvements
orca, were still included in those yaml files. We removed some but definitely not all. It requires careful auditing and testing to remove all, which is out of scope for now.@josiekre