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

spec version check fails #2089

Closed
jku opened this issue Aug 29, 2022 · 8 comments · Fixed by #2091
Closed

spec version check fails #2089

jku opened this issue Aug 29, 2022 · 8 comments · Fixed by #2091

Comments

@jku
Copy link
Member

jku commented Aug 29, 2022

spec version check currently fails on CI. I think I've seen this when using an older pip: pip install -e . thinks the project uses setuptools (either because it does not support pyproject.toml or because it gets confused by our decoy setup.py).

This could be fixed by

I assume the first one is enough, but it's possible that both are needed (if pip is old enough then it literally can't install pyproject.toml projects with "-e"). I suggest trying #2070 first.

python3 -m pip install -e .
Obtaining file:///home/runner/work/python-tuf/python-tuf
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting securesystemslib>=0.22.0
  Downloading securesystemslib-0.23.0-py3-none-any.whl (107 kB)
Requirement already satisfied: requests>=2.1[9](https://github.com/theupdateframework/python-tuf/runs/8057985831?check_suite_focus=true#step:4:10).1 in /usr/lib/python3/dist-packages (from tuf==2.0.0) (2.22.0)
Installing collected packages: securesystemslib, tuf
  Running setup.py develop for tuf
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/runner/work/python-tuf/python-tuf/setup.py'"'"'; __file__='"'"'/home/runner/work/python-tuf/python-tuf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: /home/runner/work/python-tuf/python-tuf/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/runner/work/python-tuf/python-tuf/setup.py'"'"'; __file__='"'"'/home/runner/work/python-tuf/python-tuf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
Error: Process completed with exit code 1.
@jku
Copy link
Member Author

jku commented Aug 29, 2022

huh, python-version argument for setup-python action does not have a default value: so we do not get the newest python by default, we get whatever random python happens to be installed in the CI VM -- these are not guaranteed to be same between different VMs. This will affect pip version...

We should definitely set python-version to "3.x" in this workflow and everywhere else where we don't use a specific version.

@lukpueh
Copy link
Member

lukpueh commented Aug 30, 2022

We should definitely set python-version to "3.x" [...] everywhere else where we don't use a specific version.

We already do that.

lukpueh added a commit to rdimitrov/python-tuf that referenced this issue Aug 30, 2022
1. update action/setup-python to latest version
2. pin major version to be used to 3.x
3. upgrade pip before using it

1 and 2 were suggested in theupdateframework#2089

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@lukpueh
Copy link
Member

lukpueh commented Aug 30, 2022

  • updating pip in the workflow

and

We should definitely set python-version to "3.x" in this workflow and everywhere else where we don't use a specific version.

fixed in #2001

lukpueh added a commit to lukpueh/tuf that referenced this issue Aug 30, 2022
setup.py was removed in favor of setup.cfg in theupdateframework#1626 and re-added
later in theupdateframework#1832 to work around a Dependabot issue theupdateframework#1828. This issue
seems to have been fixed upstream in dependabot/dependabot-core#5392.

Fixes theupdateframework#2089

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@jku jku closed this as completed in #2091 Aug 30, 2022
@jku
Copy link
Member Author

jku commented Aug 30, 2022

reopening just so we remember to check that the dependabot logs look good (next run should happen in an hour or two): https://github.com/theupdateframework/python-tuf/network/updates

@jku jku reopened this Aug 30, 2022
@jku
Copy link
Member Author

jku commented Aug 30, 2022

reopening just so we remember to check that the dependabot logs look good (next run should happen in an hour or two): https://github.com/theupdateframework/python-tuf/network/updates

LGTM 👍

@jku jku closed this as completed Aug 30, 2022
@jku
Copy link
Member Author

jku commented Aug 30, 2022

oops, reopening.

The spec version check still fails, likely until the python version fix from #2001 is in.

@jku jku reopened this Aug 30, 2022
@jku
Copy link
Member Author

jku commented Aug 30, 2022

oops, pip now complains: no such option: -u

Should have been -U or --upgrade, the latter is used in other workflows

@jku
Copy link
Member Author

jku commented Aug 31, 2022

All green now, thanks.

@jku jku closed this as completed Aug 31, 2022
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 a pull request may close this issue.

2 participants