Skip to content
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

Update toolchain to uv; add more linting #3

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Conversation

emsearcy
Copy link
Contributor

No description provided.

This is a dependency of boto3, but we also explicitly import from it, so
it should be listed in requirements.in.

Signed-off-by: Eric Searcy <[email protected]>
@emsearcy emsearcy merged commit ffed0bb into main Nov 27, 2024
3 checks passed
@emsearcy emsearcy deleted the ems/toolchain-updates branch November 27, 2024 20:08
Copy link
Contributor

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

Looks great!! Few small comments on installing Python versions 👀

pyenv install 3.11
pipenv install
pipenv shell
pyenv install 3.12 # or: brew install [email protected]; brew pyenv-sync
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly redundant since the uv venv step will see the .python-version and grab a uv managed Python with the correct version (and doesn't need that version on the system to be installed):

❯ make .venv
uv venv .venv
Using CPython 3.12.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
❯ which python
/Users/jpmcb/workspace/linuxfoundation/cdn-maintenance-toggle/.venv/bin/python
❯ python --version
Python 3.12.7

Comment on lines -39 to +43
pip3.11 install --user boto3 trieregex
pip install --user boto3 trieregex
# Optional: to set AWS_PROFILE or other parameters via .env:
# pip3.11 install --user python-dotenv
# pip install --user python-dotenv
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user has the .venv setup and got the packages installed via the make sync command, they shouldn't need to manually install those pacakges. Note that these packages land in the virtual env managed by uv:

❯ ll .venv/lib/python3.12/site-packages
total 96
-rw-r--r--@  1 jpmcb  staff    18B Dec  2 16:47 _virtualenv.pth
-rw-r--r--@  1 jpmcb  staff   4.2K Dec  2 16:47 _virtualenv.py
drwxr-xr-x@ 15 jpmcb  staff   480B Dec  2 16:48 boto3
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 boto3-1.35.72.dist-info
drwxr-xr-x@ 48 jpmcb  staff   1.5K Dec  2 16:48 botocore
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 botocore-1.35.72.dist-info
drwxr-xr-x@ 13 jpmcb  staff   416B Dec  2 16:48 dateutil
drwxr-xr-x@ 11 jpmcb  staff   352B Dec  2 16:48 dotenv
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 jmespath
drwxr-xr-x@  9 jpmcb  staff   288B Dec  2 16:48 jmespath-1.0.1.dist-info
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 python_dateutil-2.9.0.post0.dist-info
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 python_dotenv-1.0.1.dist-info
drwxr-xr-x@ 18 jpmcb  staff   576B Dec  2 16:48 s3transfer
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 s3transfer-0.10.4.dist-info
drwxr-xr-x@  9 jpmcb  staff   288B Dec  2 16:48 six-1.16.0.dist-info
-rw-r--r--@  1 jpmcb  staff    34K Dec  2 16:48 six.py
drwxr-xr-x@ 10 jpmcb  staff   320B Dec  2 16:48 tests
drwxr-xr-x@  5 jpmcb  staff   160B Dec  2 16:48 trieregex
drwxr-xr-x@  9 jpmcb  staff   288B Dec  2 16:48 trieregex-1.0.0.dist-info
drwxr-xr-x@ 16 jpmcb  staff   512B Dec  2 16:48 urllib3
drwxr-xr-x@  9 jpmcb  staff   288B Dec  2 16:48 urllib3-1.26.20.dist-info

If you wanted to be sure the end user has those packages installed in the venv, they can do it through the uv pip interface:

uv pip install python-dotenv

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