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

Setting up shop with SetupShop #200

Merged
merged 9 commits into from
Jun 4, 2021
Merged

Setting up shop with SetupShop #200

merged 9 commits into from
Jun 4, 2021

Conversation

blinkdog
Copy link
Contributor

Improving LTA infrastructure by using the wipac-dev-tools created by @ric-evans

@blinkdog blinkdog requested a review from ric-evans May 27, 2021 07:43
@lgtm-com
Copy link

lgtm-com bot commented May 27, 2021

This pull request introduces 1 alert when merging 07d6078 into f274bc4 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@lgtm-com
Copy link

lgtm-com bot commented May 27, 2021

This pull request introduces 1 alert when merging 4ded992 into f274bc4 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@blinkdog
Copy link
Contributor Author

I tried specifying the version of numpy to use in requirements.txt, but the install process "helped" me get the numpy 1.21.0rc1 pre-release that doesn't seem to be compatible with Python 3.6...

Installed /opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/prometheus_client-0.10.1-py3.6.egg
Searching for numpy>=1.20.3
Reading https://pypi.org/simple/numpy/
Downloading https://files.pythonhosted.org/packages/04/2f/951f612fdac05f36b115c1ee8be62a60498034e03d43700dafa4b69504ff/numpy-1.21.0rc1.zip#sha256=f5e7cd7068df4aa803be68edc7c6fc5e3ed934d53a7ab1f21539fb5925e0172e
Best match: numpy 1.21.0rc1
Processing numpy-1.21.0rc1.zip
Writing /tmp/easy_install-arjbwjxx/numpy-1.21.0rc1/setup.cfg
Running numpy-1.21.0rc1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-arjbwjxx/numpy-1.21.0rc1/egg-dist-tmp-jy0yyi5q
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-arjbwjxx/numpy-1.21.0rc1/setup.py", line 33, in <module>
    "Topic :: System :: Distributed Computing",
RuntimeError: Python version >= 3.7 required.

D'oh!

setup.py Outdated
shop = SetupShop(
"lta",
os.path.abspath(os.path.dirname(__file__)),
((3, 6), (3, 10)),
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how the GH Action will act with grabbing 3.10. But I see there's an issue

Copy link
Member

@ric-evans ric-evans May 27, 2021

Choose a reason for hiding this comment

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

running the bash lines locally, I get 3.6,3.7,3.8,3.9,3.10 so I'm inclined to think that this is happening because 3.10 has not been released. Or there's a bug in the tool I use (https://github.com/actions/setup-python).

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ahh I found the issue...

Copy link
Member

Choose a reason for hiding this comment

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

@ric-evans
Copy link
Member

I tried specifying the version of numpy to use in requirements.txt, but the install process "helped" me get the numpy 1.21.0rc1 pre-release that doesn't seem to be compatible with Python 3.6...

Yeah, that's a tricky one:

All required packages (install_requires list) are found by parsing requirements.txt. PyPI packages are assumed to be backwards-compatible, so these use the indicated version as a MINIMAL requirement (== is replaced with &gt;=).

There's a way to hack around this, but that's the last resort, especially for something stable like LTA. I recommend bumping the minimum up to 3.7, since this probably isn't something that numpy will resolve.

Copy link
Member

@ric-evans ric-evans left a comment

Choose a reason for hiding this comment

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

see comments

Comment on lines 1 to 37
name: Try Setup Install

on: [push]

jobs:

gather-py3-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.py3_versions.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- name: Python Versions
id: py3_versions
run: |
minmin_maxmax=$(grep -P "\(\(\d+, ?\d+\), ?\(\d+, ?\d+\)\)" -oh setup.py | sed 's/[^0-9]/ /g')
IFS=', ' read -r -a array <<< "$minmin_maxmax"
min_thru_max_series=$(for i in `seq ${array[1]} ${array[3]}`; do printf "3.$i,"; done | rev | cut -c 2- | rev)
echo ::set-output name=matrix::{\"py3_versions\":[$(echo $min_thru_max_series)]}\"

setup-py-install:
needs: gather-py3-versions
runs-on: ubuntu-latest

strategy:
max-parallel: 4
fail-fast: false
matrix: ${{ fromJSON(needs.gather-py3-versions.outputs.matrix) }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py3_versions }}
- run: |
echo ${{ matrix.py3_versions }}
python setup.py install
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: Try Setup Install
on: [push]
jobs:
gather-py3-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.py3_versions.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- name: Python Versions
id: py3_versions
run: |
minmin_maxmax=$(grep -P "\(\(\d+, ?\d+\), ?\(\d+, ?\d+\)\)" -oh setup.py | sed 's/[^0-9]/ /g')
IFS=', ' read -r -a array <<< "$minmin_maxmax"
min_thru_max_series=$(for i in `seq ${array[1]} ${array[3]}`; do printf "3.$i,"; done | rev | cut -c 2- | rev)
echo ::set-output name=matrix::{\"py3_versions\":[$(echo $min_thru_max_series)]}\"
setup-py-install:
needs: gather-py3-versions
runs-on: ubuntu-latest
strategy:
max-parallel: 4
fail-fast: false
matrix: ${{ fromJSON(needs.gather-py3-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py3_versions }}
- run: |
echo ${{ matrix.py3_versions }}
python setup.py install
name: Try Setup Install
on: [push]
jobs:
gather-py3-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.py3_versions.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- name: Python Versions
id: py3_versions
run: |
minmin_maxmax=$(grep -P "\(\(\d+, ?\d+\), ?\(\d+, ?\d+\)\)" -oh setup.py | sed 's/[^0-9]/ /g')
IFS=', ' read -r -a array <<< "$minmin_maxmax"
min_thru_max_series=$(for i in `seq ${array[1]} ${array[3]}`; do printf "'3.$i',"; done | rev | cut -c 2- | rev)
echo ::set-output name=matrix::{\"py3_versions\":[$(echo $min_thru_max_series)]}\"
echo $min_thru_max_series
pip-install:
needs: gather-py3-versions
runs-on: ubuntu-latest
strategy:
max-parallel: 4
fail-fast: false
matrix: ${{ fromJSON(needs.gather-py3-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py3_versions }}
- run: |
pip install --upgrade pip wheel setuptools
pip install --editable .

Copy link
Member

Choose a reason for hiding this comment

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

@blinkdog blinkdog merged commit 4a8b81a into master Jun 4, 2021
@blinkdog blinkdog deleted the setupshop branch June 4, 2021 22:32
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