Modernize packaging and current dependency compatibility - #239
Merged
Conversation
This was referenced Sep 2, 2026
… for the new packaging - test.yml: add macOS and Windows legs for the latest-dependencies job, add a docs job that builds the Sphinx documentation with warnings as errors, install the package non-editable in the test jobs, and make the twine check strict, matching orca and choicemodels - docs/source/conf.py: read the version from the package, and drop the deprecated get_html_theme_path call, which was the one warning that failed a strict build; fix the numpydoc section headers in the fidx docstring, which were the remaining (non-fatal) warnings - README, getting started, docs/README, CONTRIBUTING: Python 3.10+ and the tested platforms, the optional `network` extra for Pandana, `pip install ".[docs]"` and the strict build command, replace references to the removed setup.py and the .md file names, and add the development-version convention used in the other UDST repos - version 3.3.dev0, so builds from main are distinguishable from the released 3.2 - MANIFEST.in: ship the test suites with their data files in the sdist - requirements-min.txt: the install command in the comment matches the workflow Verified: 182 tests pass at the floors (Python 3.10, NumPy 1.26.4, pandas 2.2.3, Pandana 0.8) and at latest (Python 3.14, NumPy 2.5.2, pandas 3.0.5, Pandana 0.8); pycodestyle clean; sdist and wheel build and pass `twine check --strict`; Sphinx builds with -W on Python 3.14.
Member
|
Pushed a follow-up commit aligning some more of the details with the pattern from orca and choicemodels: Mac OS and Windows test legs, a Sphinx docs test, twine check, tests shipped in the sdist, and docs and contributor-guide updates for the new packaging. Version bumped to 3.3.dev0 so builds from main are distinguishable from the 3.2 release. Noting for future reference: Pandana is an optional dependency for UrbanSim. But we've set the dependency floor to align with Pandana 0.8 for simplicity (NumPy 1.26, Pandas 2.2). In principle we could declare+test a lower floor for people using UrbanSim without Pandana. But let's see if that's needed rather than adding the complexity now. |
smmaurer
approved these changes
Sep 3, 2026
smmaurer
added a commit
to UDST/urbansim_templates
that referenced
this pull request
Sep 9, 2026
…leanup - ci.yml: move the forward cells to Python 3.14, since UrbanSim main now supports NumPy 2 and Pandas 3 (UDST/urbansim#239); name the package in --cov so coverage measures the installed package rather than the test modules (the real figure is 82%, not the 97% previously reported); repin the temporary ChoiceModels install to the UDST/choicemodels#82 squash commit on dev, so it survives deletion of the PR branch; add a docs job that builds the Sphinx documentation with warnings as errors; run the quality and build jobs on 3.14 like the other jobs - pyproject.toml: add the 3.13 and 3.14 classifiers; enable Ruff's W605 rule; drop the coverage configuration, which was never read because pytest runs from tests/; require Sphinx 7.2 for the :no-index: option - utils.py: raw string for the regex in cols_in_expression(), which raised a SyntaxWarning on Python 3.12 and later and failed the strict docs build - docs: language = 'en', and :no-index: on repeated automodule directives (the remaining strict-build failures); getting-started, development, docs/README, tests/README, README and CONTRIBUTING updated for the removed setup.py (pip install -e ., python -m build, two version locations), the Python 3.10 requirement, and dev-branch links; drop the Scikit-learn mention, which no template uses - MANIFEST.in: ship the tests directory with its pytest.ini and the configs/ and data/ placeholders, so the suite in the sdist can run; drop requirements-extras.txt, and remove requirements-dev.txt and requirements-extras.txt, which the extras supersede - CHANGELOG: mention the docs job and the escape-sequence fix Verified locally on Python 3.14 with NumPy 2.5.3, pandas 3.0.5, UrbanSim main and ChoiceModels dev: 95 tests pass, 1 skipped, coverage 82%; ruff clean; sdist and wheel build and pass twine check --strict; Sphinx builds with -W.
smmaurer
pushed a commit
to UDST/urbansim_templates
that referenced
this pull request
Sep 9, 2026
* chore: modernize packaging and continuous integration Moves package metadata from setup.py to pyproject.toml and sets Python 3.10 as the minimum supported version, with NumPy 1.21, Pandas 1.5, Orca 1.8, and UrbanSim 3.2 as the tested dependency floors. Replaces the Travis CI configuration with a GitHub Actions workflow that tests the minimum and latest dependency versions, checks code quality, and validates the built distributions. Replaces the private Pandas cartesian-product helper used by the small multinomial logit template, which Pandas 3 removed, and fixes a warning message in the segmented multinomial logit template that never received its format argument. Removes a duplicated test and unused test variables flagged by the new quality check. * ci: pin the temporary ChoiceModels install to a development commit The dev branch still imports PyLogit at module load until UDST/choicemodels#82 merges, so the workflow installs that commit directly. * ci: test on macOS and Windows and drop the unused extras group Adds macOS and Windows cells for the current-dependency job. Removes the scikit-learn extras group, which nothing in the package or tests uses. * test: make integer dtypes explicit for Windows Two tests built integer test data with the platform default integer, which is 32-bit on Windows under NumPy 1.x, and compared it against 64-bit data. * Docs CI job, coverage fix, Python 3.14 forward cells, and packaging cleanup - ci.yml: move the forward cells to Python 3.14, since UrbanSim main now supports NumPy 2 and Pandas 3 (UDST/urbansim#239); name the package in --cov so coverage measures the installed package rather than the test modules (the real figure is 82%, not the 97% previously reported); repin the temporary ChoiceModels install to the UDST/choicemodels#82 squash commit on dev, so it survives deletion of the PR branch; add a docs job that builds the Sphinx documentation with warnings as errors; run the quality and build jobs on 3.14 like the other jobs - pyproject.toml: add the 3.13 and 3.14 classifiers; enable Ruff's W605 rule; drop the coverage configuration, which was never read because pytest runs from tests/; require Sphinx 7.2 for the :no-index: option - utils.py: raw string for the regex in cols_in_expression(), which raised a SyntaxWarning on Python 3.12 and later and failed the strict docs build - docs: language = 'en', and :no-index: on repeated automodule directives (the remaining strict-build failures); getting-started, development, docs/README, tests/README, README and CONTRIBUTING updated for the removed setup.py (pip install -e ., python -m build, two version locations), the Python 3.10 requirement, and dev-branch links; drop the Scikit-learn mention, which no template uses - MANIFEST.in: ship the tests directory with its pytest.ini and the configs/ and data/ placeholders, so the suite in the sdist can run; drop requirements-extras.txt, and remove requirements-dev.txt and requirements-extras.txt, which the extras supersede - CHANGELOG: mention the docs job and the escape-sequence fix Verified locally on Python 3.14 with NumPy 2.5.3, pandas 3.0.5, UrbanSim main and ChoiceModels dev: 95 tests pass, 1 skipped, coverage 82%; ruff clean; sdist and wheel build and pass twine check --strict; Sphinx builds with -W. * Bump the version to 0.3.dev0 The 0.2 line was only ever published as numbered development releases on GitHub, and the current dev head already depends on unreleased ChoiceModels functionality (#126). The first maintenance release will be 0.3, since #131 changes the small-MNL storage format and needs to precede it. The changelog now records #126 under 0.3.dev0, as it was merged without an entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes UrbanSim's packaging and establishes a tested dependency range from
Python 3.10 with minimum dependencies through Python 3.14 with current
dependencies.
Packaging and dependency policy
setup.pytopyproject.toml;source tree; and
Pandana remains optional for the core UrbanSim installation. It is exposed
through the
networkextra and installed in both test environments so that theexisting
urbansim.utils.networksintegration remains covered.Compatibility changes
.locassignmentsthat work under Pandas 3 copy-on-write semantics;
HDF loader; and
Verification
twine checkpasses for both artifacts.This pull request does not change the UrbanSim version, publish a release, or
address the transition-model integrity problem in #233.
Refs #234.