-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
The new GitHub action does not work? #643
Comments
Hmm, looks like it's saying you need e.g If this syntax works how I think it does you should be able to do e.g |
Thanks for the suggestion @FollowTheProcess it seems better but I have another issue, I don't know how nox configures python, in my configuration file above, I explicitly setup nox python to the one configured in the matrix but I have this: Two versions of python are configured and therefore it creates issues when installing dependencies Run nox -t security
nox > Running session bandit
nox > Creating virtual environment (virtualenv) using python in .nox/bandit
nox > poetry install
nox > Warning: poetry is not installed into the virtualenv, it is located at /opt/hostedtoolcache/Python/3.10.6/x64/bin/poetry. This might cause issues! Pass external=True into run() to silence this message.
Installing dependencies from lock file
Package operations: 49 installs, 0 updates, 0 removals
• Installing idna (3.3)
• Installing sniffio (1.2.0)
AttributeError
'Link' object has no attribute 'is_absolute'
at /opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/poetry/core/packages/file_dependency.py:33 in __init__
29│ self._path = path
30│ self._base = base or Path.cwd()
31│ self._full_path = path
32│
→ 33│ if not self._path.is_absolute():
34│ try:
35│ self._full_path = self._base.joinpath(self._path).resolve()
36│ except FileNotFoundError:
37│ raise ValueError("Directory {} does not exist".format(self._path))
AttributeError
'Link' object has no attribute 'is_absolute'
at /opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/poetry/core/packages/file_dependency.py:33 in __init__
[29](https://github.com/lewoudar/noxtest/runs/7753186725?check_suite_focus=true#step:7:30)│ self._path = path
30│ self._base = base or Path.cwd()
31│ self._full_path = path
32│
→ 33│ if not self._path.is_absolute():
34│ try:
35│ self._full_path = self._base.joinpath(self._path).resolve()
36│ except FileNotFoundError:
[37](https://github.com/lewoudar/noxtest/runs/7753186725?check_suite_focus=true#step:7:38)│ raise ValueError("Directory {} does not exist".format(self._path)) Anyway, the documentation should have a basic template to help us understand how it works ^^ |
Hmm, I know that the Nox action sets up it's own pythons internally which may be why this is happening. What happens if you remove the setup-python step and just use the Nox action to setup the python matrix as described here https://nox.thea.codes/en/stable/tutorial.html?highlight=action#installation |
I end up with something like this (thanks for the suggestion): ...
jobs:
build:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
# python: [ pypy-3.7, pypy-3.8, 3.7, 3.8, 3.9, '3.10' ]
steps:
- uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python }}
- name: Set up nox
uses: wntrblm/nox@2022.8.7
# with:
# python-versions: ${{ matrix.python }} It works now but man, I don't understand what is going on. I see that multiple python versions are configured, but how do I use them? Also I just realize that this action does not fit my general workflow since I install nox and run tests locally before doing it on GitHub. |
I just set that up for one of my workflows: The action only makes the Python versions and Nox available, you still have to tell Nox to use the ones you want. E.g. in @nox.session(python=['3.9', '3.10'])
def test(session):
# your test commands here |
@airtower-luna thanks for the clarification. This confirms that the documentation needs to be updated. |
This is a general problem when mixing pipx and nox, not just related to the action. If you run - uses: actions/setup-python@v4
with:
python-version: 3.11-dev
- run: pipx run --python python nox you'll get the active version of Python when running nox, but nox for some reason doesn't try to use the Python that ran it (via |
Current Behavior
I'm trying the new GitHub action in a dummy project and I ended up with this ci file
When GitHub action is launched, I immediately receive this message:
Expected Behavior
The GitHub action should run without error.
Steps To Reproduce
Use a GitHub action file like the previous one I put.
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: