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

NickAkhmetov/Python 3.10, uv #3654

Merged
merged 7 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.12
3.10.16
73 changes: 19 additions & 54 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"label": "pip install",
"type": "shell",
"command": "PIP_CONSTRAINT=context/constraints.txt pip install -r context/requirements.txt --use-deprecated=legacy-resolver",
"command": "PIP_CONSTRAINT=context/constraints.txt uv pip sync context/requirements.txt",
"group": {
"kind": "build",
"isDefault": false
Expand Down Expand Up @@ -48,19 +48,14 @@
"kind": "build",
"isDefault": false
},
"dependsOn": [
"pip install",
"npm install"
],
"dependsOn": ["pip install", "npm install"],
"dependsOrder": "parallel"
},
{
"label": "Flask Server",
"type": "shell",
"command": "${command:python.interpreterPath} -m flask run --debug",
"dependsOn": [
"Copy app configuration"
],
"dependsOn": ["Copy app configuration"],
"options": {
"cwd": "${workspaceFolder}/context",
"env": {
Expand All @@ -74,7 +69,7 @@
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "",
"regexp": ""
},
"background": {
"activeOnStart": true,
Expand All @@ -85,19 +80,15 @@
},
{
"label": "Flask Server (+ pip install)",
"dependsOn": [
"pip install",
"Flask Server"
],
"dependsOrder": "sequence"
"dependsOn": ["pip install", "Flask Server"],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "npm run lint",
"type": "npm",
"script": "lint",
"problemMatcher": [
"$eslint-stylish"
],
"problemMatcher": ["$eslint-stylish"],
"options": {
"cwd": "${workspaceFolder}/context"
},
Expand Down Expand Up @@ -133,10 +124,7 @@
},
{
"label": "React Dev Server (+ lint)",
"dependsOn": [
"npm run lint",
"React Dev Server"
],
"dependsOn": ["npm run lint", "React Dev Server"],
"dependsOrder": "sequence"
},
{
Expand All @@ -163,41 +151,25 @@
},
{
"label": "dev-start (no install)",
"dependsOn": [
"Flask Server",
"React Dev Server (+ lint)",
"Storybook"
],
"dependsOn": ["Flask Server", "React Dev Server (+ lint)", "Storybook"],
"dependsOrder": "parallel",
"problemMatcher": [
"$eslint-stylish"
]
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "dev-start",
"dependsOn": [
"Install dependencies",
"dev-start (no install)"
],
"dependsOn": ["Install dependencies", "dev-start (no install)"],
"group": {
"kind": "build",
"isDefault": true
},
"dependsOrder": "sequence",
"problemMatcher": [
"$eslint-stylish"
]
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "dev-start (no storybook, no install)",
"dependsOn": [
"Flask Server",
"React Dev Server (+ lint)"
],
"dependsOn": ["Flask Server", "React Dev Server (+ lint)"],
"dependsOrder": "parallel",
"problemMatcher": [
"$eslint-stylish"
]
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "dev-start (no storybook)",
Expand All @@ -206,20 +178,13 @@
"dev-start (no storybook, no install)"
],
"dependsOrder": "sequence",
"problemMatcher": [
"$eslint-stylish"
]
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "dev-start (no storybook, no install, no lint)",
"dependsOn": [
"Flask Server",
"React Dev Server"
],
"dependsOn": ["Flask Server", "React Dev Server"],
"dependsOrder": "parallel",
"problemMatcher": [
"$eslint-stylish"
]
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "Kill project ports",
Expand All @@ -230,4 +195,4 @@
"command": "npx --yes kill-port 5000 5001 6006"
}
]
}
}
2 changes: 2 additions & 0 deletions CHANGELOG-python-3.10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Upgrade to Python 3.10.
NickAkhmetov marked this conversation as resolved.
Show resolved Hide resolved
- Introduce `uv` for python package management.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,17 @@ All designs are in [Figma](https://www.figma.com/files/team/834568130405102661/H
### Prerequisites

- `git`: Suggest [installing Apple XCode](https://developer.apple.com/xcode/).
- `python 3.9`
- `python 3.10`
- `uv` (Recommended):
- [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/) using any supported installation method.
- Create a `uv` virtual environment with the appropriate python version via `uv venv --python $(cat .python-version)`.
- Activate the environment with `source .venv/bin/activate`.
- Install locked requirements with `uv pip sync context/requirements.txt` and `uv pip sync context/requirements-dev.txt`.
- MiniConda:
- [installing miniconda](https://docs.conda.io/en/latest/miniconda.html#macosx-installers) and [creating a new conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands): `conda create -n portal python=$(cat .python-version)`
- pyenv:
- `brew install pyenv`
- `brew install pyenv-virtualenv`
- `brew install pyenv-virtualenv`
- cd into portal-ui (or provide full path to /portal-ui/.python-version file)
- `` pyenv install `cat .python-version` ``
- `` pyenv virtualenv `cat .python-version` portal ``
Expand Down
138 changes: 37 additions & 101 deletions context/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,142 +1,78 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=context/requirements-dev.txt context/requirements-dev.in
#
autopep8==1.4.4 \
--hash=sha256:4d8eec30cc81bc5617dbf1218201d770dc35629363547f17577c61683ccfb3ee
# This file was autogenerated by uv via the following command:
# uv pip compile context/requirements-dev.in --universal --output-file context/requirements-dev.txt
autopep8==1.4.4
# via -r context/requirements-dev.in
boto3==1.26.154 \
--hash=sha256:cf1067d101be538f399b685bbe6beb4bfed01095da8497d0c7fa8b8788a65c6b \
--hash=sha256:ee2b3733f40f935da78bf76bc8e82af6e90841406e04605e3b2d765b50cad05e
boto3==1.26.154
# via -r context/requirements-dev.in
botocore==1.29.154 \
--hash=sha256:a9c7da497ac5f7d4f3e932b4442e7c32cc2936f3a4658165f1528336fc429c3d \
--hash=sha256:b9853f72a3c93f1aa8c9a1636911cdbec3662bca2e04e4ee00437c4f8c9fa2d4
botocore==1.29.154
# via
# boto3
# s3transfer
build==1.2.1 \
--hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \
--hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4
build==1.2.1
# via pip-tools
click==8.1.0 \
--hash=sha256:19a4baa64da924c5e0cd889aba8e947f280309f1a2ce0947a3e3a7bcb7cc72d6 \
--hash=sha256:977c213473c7665d3aa092b41ff12063227751c41d7b17165013e10069cc5cd2
click==8.1.0
# via pip-tools
entrypoints==0.3 \
--hash=sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19 \
--hash=sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451
colorama==0.4.6 ; os_name == 'nt' or (platform_system == 'Windows' and sys_platform != 'win32') or sys_platform == 'win32'
# via
# build
# click
# pytest
entrypoints==0.3
# via flake8
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
exceptiongroup==1.2.1 ; python_full_version < '3.11'
# via pytest
flake8==3.7.8 \
--hash=sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548 \
--hash=sha256:8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696
flake8==3.7.8
# via -r context/requirements-dev.in
importlib-metadata==8.0.0 \
--hash=sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f \
--hash=sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812
# via build
iniconfig==1.1.1 \
--hash=sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3 \
--hash=sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32
iniconfig==1.1.1
# via pytest
jmespath==1.0.1 \
--hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \
--hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe
jmespath==1.0.1
# via
# boto3
# botocore
mccabe==0.6.1 \
--hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 \
--hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f
mccabe==0.6.1
# via flake8
packaging==21.3 \
--hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \
--hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522
packaging==21.3
# via
# build
# pytest
pip-tools==7.4.1 \
--hash=sha256:4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9 \
--hash=sha256:864826f5073864450e24dbeeb85ce3920cdfb09848a3d69ebf537b521f14bcc9
pip==24.1.1
# via pip-tools
pip-tools==7.4.1
# via -r context/requirements-dev.in
pluggy==1.5.0 \
--hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \
--hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669
pluggy==1.5.0
# via pytest
pycodestyle==2.5.0 \
--hash=sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56 \
--hash=sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c
pycodestyle==2.5.0
# via
# autopep8
# flake8
pyflakes==2.1.1 \
--hash=sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0 \
--hash=sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2
pyflakes==2.1.1
# via flake8
pyparsing==3.0.7 \
--hash=sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea \
--hash=sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484
pyparsing==3.0.7
# via packaging
pyproject-hooks==1.1.0 \
--hash=sha256:4b37730834edbd6bd37f26ece6b44802fb1c1ee2ece0e54ddff8bfc06db86965 \
--hash=sha256:7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.2.2 \
--hash=sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343 \
--hash=sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977
pytest==8.2.2
# via
# -r context/requirements-dev.in
# pytest-mock
pytest-mock==3.14.0 \
--hash=sha256:0b72c38033392a5f4621342fe11e9219ac11ec9d375f8e2a0c164539e0d70f6f \
--hash=sha256:2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0
pytest-mock==3.14.0
# via -r context/requirements-dev.in
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
python-dateutil==2.8.2
# via botocore
s3transfer==0.6.1 \
--hash=sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346 \
--hash=sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9
s3transfer==0.6.1
# via boto3
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
setuptools==70.0.0
# via pip-tools
six==1.16.0
# via python-dateutil
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
tomli==2.0.1 ; python_full_version < '3.11'
# via
# build
# pip-tools
# pytest
urllib3==1.26.17 \
--hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \
--hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b
urllib3==1.26.17
# via botocore
wheel==0.38.1 \
--hash=sha256:7a95f9a8dc0924ef318bd55b616112c70903192f524d120acc614f59547a9e1f \
--hash=sha256:ea041edf63f4ccba53ad6e035427997b3bb10ee88a4cd014ae82aeb9eea77bb9
# via pip-tools
zipp==3.19.2 \
--hash=sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19 \
--hash=sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
pip==24.1.1 \
--hash=sha256:5aa64f65e1952733ee0a9a9b1f52496ebdb3f3077cc46f80a16d983b58d1180a \
--hash=sha256:efca15145a95e95c00608afeab66311d40bfb73bb2266a855befd705e6bb15a0
# via pip-tools
setuptools==70.0.0 \
--hash=sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4 \
--hash=sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0
wheel==0.38.1
# via pip-tools
6 changes: 3 additions & 3 deletions context/requirements.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Update requirements.txt if this file changes:
# pip install pip-tools
# pip-compile --allow-unsafe --generate-hashes --output-file=context/requirements.txt context/requirements.in
Flask>=3.0.3
Flask[async]>=3.0.3
Flask>=3.1.0
Flask[async]>=3.1.0
globus-sdk>=3.9.0
requests>=2.32.3
pyyaml>=6.0.1
python-datauri>=2.2.0
python-frontmatter>=1.1.0
hubmap-api-py-client>=0.0.11
hubmap-commons>=2.1.15
hubmap-commons>=2.1.18
# As of 2023-08-24, this is the version of boto3 which is compatible with both the
# portal-visualization->vitessce->ome-zarr dependency on aiobotocore~=2.5
# and the hubmap-commons dependency on boto3>=1.24.47
Expand Down
Loading
Loading