Skip to content

chore[build]: simplify onboarding#4886

Open
Sporarum wants to merge 21 commits intovyperlang:masterfrom
Sporarum:enable-uv
Open

chore[build]: simplify onboarding#4886
Sporarum wants to merge 21 commits intovyperlang:masterfrom
Sporarum:enable-uv

Conversation

@Sporarum
Copy link
Copy Markdown
Collaborator

@Sporarum Sporarum commented Mar 20, 2026

What I did

How I did it

How to verify it

Commit message

this commit moves most configuration to pyproject.toml to enable
downloading all dependencies with `uv sync`. this commit makes the
contributing section of the readme clearer and adds installation steps
for both pip and uv. there should not be any semantic differences in the
metadata, and the pip workflow should remain identical.
py_modules=["vyper"] is removed, it did nothing as there is no
`vyper.py` module file (packages=["vyper"] remains). the version scheme
remains identical, but is refactored for simplicity. the docs
dependencies are moved to pyproject.toml, and the readthedocs settings
are updated accordingly.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 20, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedipython@​9.12.07310010010070
Addedpyinstaller@​6.20.07310010010070
Addedmypy@​1.19.082100100100100
Addedblack@​23.12.08583100100100
Addedpre-commit@​4.6.093100100100100
Addedisort@​5.13.298100100100100
Addedtwine@​6.2.098100100100100
Addedvyper@​0.4.3100100100100100
Addedflake8@​6.1.0100100100100100
Addedflake8-use-fstring@​1.4100100100100100
Addedflake8-bugbear@​23.12.2100100100100100

View full report

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c52924092

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread requirements-docs.txt
Comment thread .readthedocs.yaml Outdated
Comment thread setup.py
Comment on lines 32 to 36
setup(
name="vyper",
use_scm_version={
"local_scheme": _local_version,
"local_scheme": _local_version_suffix,
"version_scheme": _global_version,
"write_to": "vyper/version.py",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve setuptools_scm for the setup.py install path

The documented pip path still goes through make init / make.cmd init, which invoke python setup.py install, but this file no longer bootstraps setuptools_scm. In a fresh venv with only setuptools installed, python setup.py --version now warns that use_scm_version is unknown and reports 0.0.0, so contributors following the README get an incorrectly versioned compiler unless they manually install setuptools_scm first.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the setup steps in the readme for both uv and pip leads to the correct version
(checked on a mktemp --directory)

A version of 0.0.0 is most likely due to forgetting to fetch the tags

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 20, 2026

📊 Bytecode Size Changes (venom)

No changes detected.

Full bytecode sizes

Contract legacy-O2 legacy-Os -O2 -O3 -Os
curvefi/amm/stableswap/meta_implementation/meta_implementation_v_700.vy 23610 22805 21024 19962 19523
curvefi/legacy/CurveStableSwapMetaNG.vy 24952 23578 20778 20129 19433
curvefi/amm/stableswap/implementation/implementation_v_700.vy 24962 23769 20578 19677 19129
curvefi/legacy/CurveStableSwapNG.vy 24473 23298 19967 19093 18574
curvefi/amm/tricryptoswap/implementation/implementation_v_200.vy 20590 19825 18213 17685 17129
yearnfi/VaultV3.vy 19972 19063 17214 15296 14644
curvefi/amm/twocryptoswap/implementation/implementation_v_210.vy 18090 17350 16458 15812 15330
curvefi/legacy/CurveCryptoSwap2.vy 18947 18382 15660 15103 14737
yearnfi/VaultV2.vy 16676 15763 14064 13578 12745
curvefi/amm/stableswap/factory/factory_v_100.vy 14558 13978 13429 11997 11978
curvefi/gauge/child_gauge/implementation/implementation_v_110.vy 12338 11561 10419 9885 9301
curvefi/amm/stableswap/views/views_v_120.vy 12784 12368 10390 9748 9892
curvefi/gauge/child_gauge/implementation/implementation_v_100.vy 12017 11249 10127 9592 9019
curvefi/amm/tricryptoswap/math/math_v_200.vy 11055 10992 9573 8177 8452
curvefi/legacy/CurveCryptoMathOptimized3.vy 11054 10991 9572 8177 8452
curvefi/gauge/child_gauge/implementation/implementation_v_020.vy 10665 9947 9187 8654 8142
curvefi/helpers/router/router_v_110.vy 6717 6717 7136 6477 6710
curvefi/amm/tricryptoswap/views/views_v_200.vy 7821 7776 7075 6793 6862
curvefi/registries/metaregistry/metaregistry_v_110.vy 7590 6732 6989 6132 6035
curvefi/helpers/stable_swap_meta_zap/stable_swap_meta_zap_v_100.vy 7302 7067 6650 6256 6355
curvefi/amm/twocryptoswap/views/views_v_200.vy 6991 6946 6535 6262 6322
curvefi/registries/metaregistry/registry_handlers/stableswap/handler_v_110.vy 6633 6259 6199 5388 5842
curvefi/amm/tricryptoswap/factory/factory_v_200.vy 5246 5021 5979 4974 5086
curvefi/amm/twocryptoswap/factory/factory_v_200.vy 5540 5252 5972 4695 4866
curvefi/amm/twocryptoswap/math/math_v_210.vy 6666 6666 5582 5098 5103
curvefi/gauge/child_gauge/factory/factory_v_201.vy 4844 4547 4365 4083 3849
yearnfi/VaultFactory.vy 3765 3617 4021 2524 3003
curvefi/registries/metaregistry/registry_handlers/tricryptoswap/handler_v_110.vy 4241 3939 3968 3649 3647
curvefi/registries/metaregistry/registry_handlers/twocryptoswap/handler_v_110.vy 4186 3884 3905 3517 3531
curvefi/gauge/child_gauge/factory/factory_v_100.vy 4183 3914 3783 3487 3272
curvefi/helpers/rate_provider/rate_provider_v_101.vy 3260 3260 2872 2500 2513
curvefi/registries/address_provider/address_provider_v_201.vy 2973 2782 2794 2620 2475
curvefi/amm/stableswap/math/math_v_100.vy 3067 3046 2655 2430 2450
curvefi/helpers/rate_provider/rate_provider_v_100.vy 2847 2841 2451 2114 2122
curvefi/helpers/deposit_and_stake_zap/deposit_and_stake_zap_v_100.vy 2322 2316 2212 1949 1980
curvefi/governance/relayer/taiko/relayer_v_001.vy 2068 2064 1711 1565 1599
curvefi/governance/relayer/polygon_cdk/relayer_v_101.vy 1556 1523 1523 1401 1402
curvefi/governance/relayer/arb_orbit/relayer_v_101.vy 1266 1262 1207 1111 1142
curvefi/governance/relayer/op_stack/relayer_v_101.vy 1186 1182 1146 1053 1081
curvefi/governance/relayer/not_rollup/relayer_v_100.vy 1168 1153 1143 1056 1068
curvefi/governance/vault/vault_v_100.vy 964 941 956 907 905
curvefi/governance/agent/agent_v_100.vy 541 541 498 440 444
curvefi/governance/agent/agent_v_101.vy 541 541 498 440 444
curvefi/governance/relayer/relayer_v_100.vy 496 496 467 462 467

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.98%. Comparing base (5ea0f38) to head (c9422a8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4886      +/-   ##
==========================================
+ Coverage   91.93%   91.98%   +0.05%     
==========================================
  Files         186      186              
  Lines       27567    27564       -3     
  Branches     4816     4816              
==========================================
+ Hits        25343    25355      +12     
+ Misses       1509     1493      -16     
- Partials      715      716       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread README.md Outdated
Comment thread .gitignore
Comment thread .readthedocs.yaml Outdated
python: "3.11"
jobs:
pre_create_environment:
- asdf plugin add uv
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readthedocs env has asdf?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to do, Claude did that and it worked (the current readthedocs failure was caused by the outdated main, not these changes)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just don't understand why we need it, is it so that readthedocs runs uv? but why do we need that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to be able to remove the requirements-docs.txt file
(as suggested by its own TODO)

There might be a way to make it work with pip, but IIRC it also involved using asdf

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also makes it easier to test the docs locally

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to pip in the end

@charles-cooper
Copy link
Copy Markdown
Member

looks like readthedocs build is failing

Comment thread pyproject.toml Outdated
Comment thread README.md

```bash
make dev-init
./quicktest.sh -m "not fuzzing"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to the installation instructions, since it only concerns pip

Comment thread README.md
1. Clone this repo and `cd` into it
2. Run `git fetch --tags git@github.com:vyperlang/vyper.git` to get the tags necessary for version inference
3. Run `uv sync`
4. Run `source .venv/bin/activate` to activate the virtual environment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does uv venv or something do this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv venv create a venv, but does not activate it (probably for safety reasons ?)
And it's performed as part of uv sync

For automatically activating the venv there are things like direnv, which I highly recommend, but was not sure if it should be added to the readme, since it's not required

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good tutorial ?
https://www.ashleyconnor.co.uk/til/2025-03-01-how-to-automatically-activate-venv-with-direnv

I use a more convoluted way with nix shells, so I've not tried it tho

Comment thread README.md

## Developing (working on the compiler)
1. Clone this repo and `cd` into it
2. Run `git fetch --tags git@github.com:vyperlang/vyper.git` to get the tags necessary for version inference
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the compiler not work without this step?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does run, but fails if the file has a version pragma, and as a result the tests do not pass

Comment thread setup.cfg Outdated
[metadata]
license_files = LICENSE

# TODO: Does anyone use `python setup.py test` ?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that should probably be removed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread setup.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we now need setup.py in addition to pyproject?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As requested, I moved the metadata back to setup.py, while the rest (dependencies and their settings) are in pyproject.toml

It's possible to also have almost everything in pyproject.toml
(the only thing I was not able to move was the git-tag-based version logic, since we do something non-standard)

And it's also not possible to not have pyproject.toml

  • black requires it, which is why it existed before this PR
  • IIRC uv requires it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an additional argument to having metadata in pyproject.toml, the PyPA recommends it:

On the other hand, configuring setuptools with a setup.py file is still fully supported, although it is recommended to use the modern [project] table in pyproject.toml (or setup.cfg) whenever possible

Source: https://packaging.python.org/en/latest/guides/tool-recommendations/#build-backends

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