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

py.path has been renamed? (ModuleNotFoundError: No module named 'py') #153

Open
Huite opened this issue Dec 11, 2022 · 6 comments
Open

py.path has been renamed? (ModuleNotFoundError: No module named 'py') #153

Huite opened this issue Dec 11, 2022 · 6 comments

Comments

@Huite
Copy link

Huite commented Dec 11, 2022

My CI pipelines using tox-conda don't seem to work anymore as of recently, as I get the following error:

  File "/home/runner/work/xugrid/xugrid/.tox/.tox/lib/python3.10/site-packages/tox_conda/plugin.py", line 10, in <module>
    import py.path
ModuleNotFoundError: No module named 'py'

I have a suspicion this is because py.path has been renamed to path?

See: https://pypi.org/project/path.py/
and: https://pypi.org/project/path/

@Huite
Copy link
Author

Huite commented Dec 11, 2022

After looking a little more: it seems like py.path was being used before, but I don't see it mentioned in setup.cfg.

Maybe it was present due to an other dependency, but not anymore?

@AntoineD
Copy link
Collaborator

py.path is part of the py package that is a dependency of tox version 3 and tox-conda only supports this version for now.

@Huite
Copy link
Author

Huite commented Dec 12, 2022

Ah right, that explains it -- it would've taken quite some time to figure it out.

Maybe it's worthwhile to mention this in the README? Currently, I guess I could've figured it by checking the setup.cfg, but that's not quite obvious.

I'll install tox < 4. Thanks!

@AntoineD
Copy link
Collaborator

I'm surprised the current tox-conda could be installed with tox 4 because tox-conda has a constraint on the version of tox.
Do you know why this happens?

@Huite
Copy link
Author

Huite commented Dec 13, 2022

My ci.yml looks like this:

  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: install mamba
        uses: mamba-org/provision-with-micromamba@main

      - name: Test and build with tox
        run: |
          pip install tox
          tox -e build
      - uses: codecov/codecov-action@v1

The start of my tox.ini:

[tox]
requires = tox-conda
isolated_build = True
setenv =
    CONDA_EXE=mamba

I think I could've avoided it by using pip install tox-conda instead of pip install tox.
In this case, it must be tox installing tox-conda. I'm not sure why I set it up this way, most likely because I started with a standard tox configuration, and then found a way to use tox-conda.

@AntoineD
Copy link
Collaborator

It turns out that when tox creates the provisional env to install tox-condapip find an old version (0.8.1) of tox-conda that has no constraint on the version of tox.

So it seems the only solution to this is what you already did, i.e. install tox<4

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

No branches or pull requests

2 participants