Skip to content

add: if for scipy and linting #251

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

Merged
merged 10 commits into from
Jun 21, 2024
Merged

add: if for scipy and linting #251

merged 10 commits into from
Jun 21, 2024

Conversation

3sky
Copy link
Contributor

@3sky 3sky commented Jun 18, 2024

The most important part is:

python3 -c '
import sys
version = sys.version_info
if version.major == 3 and version.minor == 11:
    print("pip3 install --no-deps --upgrade scipy==1.10.0")
else:
    print("pip3 install --no-deps --upgrade scipy==1.8.0")
' | sh

It's needed during working with python 3.11.
Tests:

kuba@mace:~$ docker run -it --rm --entrypoint bash python:3.10
root@e56bfe8135cb:/# python3 -c '
import sys
version = sys.version_info
if version.major == 3 and version.minor == 11:
    print("pip3 install --no-deps --upgrade scipy==1.10.0")
else:
    print("pip3 install --no-deps --upgrade scipy==1.8.0")
' | sh
Collecting scipy==1.8.0
  Downloading scipy-1.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (39.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.0/39.0 MB 40.4 MB/s eta 0:00:00
Installing collected packages: scipy
Successfully installed scipy-1.8.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
root@e56bfe8135cb:/#
exit
kuba@mace:~$ docker run -it --rm --entrypoint bash python:3.11
root@09f14ef087df:/# python3 -c '
import sys
version = sys.version_info
if version.major == 3 and version.minor == 11:
    print("pip3 install --no-deps --upgrade scipy==1.10.0")
else:
    print("pip3 install --no-deps --upgrade scipy==1.8.0")
' | sh
Collecting scipy==1.10.0
  Downloading scipy-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (110 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 110.1/110.1 kB 3.3 MB/s eta 0:00:00
Downloading scipy-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (30.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.7/30.7 MB 46.7 MB/s eta 0:00:00
Installing collected packages: scipy
Successfully installed scipy-1.10.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@09f14ef087df:/#

setup_deb.sh Outdated
kornia==0.6 \
invisible-watermark \
streamlit-drawable-canvas==0.8.0 \
safetensors >=0.1.1 >=0.7.5 >=0.73.1 >=0.1.5 >=0.3.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like version specifiers of a few different packages got moved into this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, missed that.

setup_deb.sh Outdated
Comment on lines 95 to 102
python3 -c '
import sys
version = sys.version_info
if version.major == 3 and version.minor == 11:
print("pip3 install --no-deps --upgrade scipy==1.10.0")
else:
print("pip3 install --no-deps --upgrade scipy==1.8.0")
' | sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a fan of this. I think we should instead move all Python requirements to a requirements.txt file and use environment markers in cases like this https://peps.python.org/pep-0508/#environment-markers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. Using requirements.txt with 'python_version' marker will be much more elegant solution. I'm using it in manifests repo. However, it's up to you, If I can make this change, as it's big one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the behaviour should stay the same if we keep all the flags and versions the same, so it wouldn't be that big of a change. @jan-grzybek-ampere what do you think?

@3sky 3sky requested a review from dkupnicki June 18, 2024 11:47
setup_deb.sh Outdated
safetensors>=0.3.1

# get almost all python deps
pip3 install --no-deps --upgrade -r requirments.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a typo here, but other than that I think everything looks fine

@jan-grzybek-ampere jan-grzybek-ampere merged commit fa69af3 into main Jun 21, 2024
9 checks passed
@jan-grzybek-ampere jan-grzybek-ampere deleted the kuba/support-p311 branch June 21, 2024 09:16
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.

3 participants