Replace setup.py packaging with pyproject.toml, add uv - #474
Draft
ryanleary wants to merge 1 commit into
Draft
Conversation
ryanleary
force-pushed
the
pr4-modernize-packaging
branch
from
August 19, 2026 20:52
abaffe9 to
3384df8
Compare
ryanleary
force-pushed
the
pr4-modernize-packaging
branch
from
August 19, 2026 21:01
3384df8 to
3338820
Compare
Move to a standard PEP 621 build, removing setup.py, setup.cfg, MANIFEST.in,
reinstall.sh, the requirements/ directory and the stray repository-root
__init__.py. Dependencies, extras, classifiers, package data and the black,
isort and pytest settings all move into pyproject.toml unchanged; the version
still comes from nemo_text_processing/package_info.py, now via
[tool.setuptools.dynamic].
Three latent defects surface as a result of declaring things properly:
* The wheel was shipping the test suite. packages=find_packages() picked up
tests/ because it has an __init__.py, and the exclude=[...] argument was
passed to setup() where it is not a parameter and did nothing. The built
wheel drops 247 files under tests/ and is otherwise identical, file for
file, to the one setup.py produced.
* requires-python was never declared while the classifiers claimed 3.8. The
test extra pins black==25.1.0, which needs >=3.9, so [all] has been
unsatisfiable on 3.8. Declared >=3.9 to match what the dependencies
actually allow.
* isort[requirements] asks for an extra isort does not have, so the marker
silently did nothing. Dropped.
Jenkins now builds a wheel with uv and installs that, in place of
reinstall.sh. No uv.lock is committed: this is a library, so the resolution
that matters is the consumer's, and pynini publishes manylinux x86_64 wheels
only.
pyproject.toml also documents the two-line change that adds a native runtime
package to a [tool.uv.workspace] later, and why that has to be a separate
distribution rather than an extra of this one.
Signed-off-by: Ryan Leary <rleary@nvidia.com>
ryanleary
force-pushed
the
pr4-modernize-packaging
branch
from
August 19, 2026 21:18
3338820 to
7f2796a
Compare
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.
What does this PR do ?
Moves the project onto a standard PEP 621 build: one
pyproject.tomlreplacessetup.py,setup.cfg,MANIFEST.in,reinstall.shandrequirements/. Addsuvfor development environments, and removes the repository-root__init__.py.The built wheel is unchanged apart from the first fix below — same
py3-none-anytag, same version, same extras, same 13 runtime dependencies, everynemo_text_processing/file preserved.Problems this fixes
The wheel has been shipping the test suite.
packages=find_packages()picks uptests/because it has an__init__.py, and theexclude=['tools', 'tests', 'data']argument was passed tosetup(), where it is not a parameter and did nothing. Every release installs 247 test files into site-packages, including an importable top-leveltestspackage. The new wheel drops them and is otherwise identical, file for file:[all]has been unsatisfiable on Python 3.8. The classifiers claimed 3.8 while thetestextra pinsblack==25.1.0, which requires>=3.9. Nothing declaredrequires-python, so pip installed on 3.8 and failed later. Now declared>=3.9.isort[requirements]requests an extra isort does not have, so the marker did nothing. Dropped.What changes for users
./reinstall.shbecomesuv sync.pip install -e ".[all]"andpip install nemo_text_processing[all]are unaffected — this is a plain PEP 621 package, and uv is a convenience rather than a requirement. Nouv.lockis committed.Testing
tests/nemo_text_processing/en: 1613 passed, 2 failed — both pre-existing on an unmodified checkout (test_ordinal.py::test_norm_26_111st,test_serial.py::test_norm_32_your_otp_is_ab9453). black, isort and pytest settings resolve unchanged;uv buildproduces wheel and sdist with all data files and noMANIFEST.in.Before your PR is "Ready for review"
Pre checks:
git commit -sto sign.__init__.pyfor every folder and subfolder — no folders added; one stray root-level__init__.pyremoved.pyproject.tomlcarries it.try import: ... except: ...) if not already done — none introduced.pynini_export.py— N/A.PR Type:
🤖 Generated with Claude Code