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

ARMI cannot be installed in editable mode with pip<22.1 #1639

Closed
ntouran opened this issue Jan 30, 2024 · 6 comments · Fixed by #1664
Closed

ARMI cannot be installed in editable mode with pip<22.1 #1639

ntouran opened this issue Jan 30, 2024 · 6 comments · Fixed by #1664
Assignees
Labels
bug Something is wrong: Highest Priority documentation Improvements or additions to documentation

Comments

@ntouran
Copy link
Member

ntouran commented Jan 30, 2024

Installation instructions for editable install not working: Since it does not have a setup.py nor a setup.cfg, it cannot be installed in editable mode.

Docs say:

Now install ARMI with all its dependencies::
(armi-venv) $ cd armi
(armi-venv) $ pip install -e .[test]

But if you do this, you get an error:

(venv) $ pip install -e .[test]
Obtaining file:///home/nick/code/armi
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
ERROR: Project file:///home/nick/code/armi has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.

I am using pip==22.0.2.

@ntouran ntouran added bug Something is wrong: Highest Priority documentation Improvements or additions to documentation labels Jan 30, 2024
@ntouran
Copy link
Member Author

ntouran commented Jan 30, 2024

Hmm, according to this, we may need to require setuptools 64

@ntouran
Copy link
Member Author

ntouran commented Jan 30, 2024

Upgrading pip to 23.3.2 works!

python -m pip install --upgrade pip

We should reflect this somewhere in the setup docs I guess.

@ntouran
Copy link
Member Author

ntouran commented Jan 30, 2024

The other thing we can do is just add a stub setup.py or setup.cfg which will restore the old behavior. I'll make a PR.

ntouran added a commit to ntouran/armi that referenced this issue Jan 30, 2024
In order to run:

    pip install -e .[docs,tests]

We found that you either need to add a stub setup.py like this or be
using a very recent version of pip. In order to streamline the
installation process on more machines with a relaxed pip version
constraint, this stub is added.

Fixes terrapower#1639.
ntouran added a commit to ntouran/armi that referenced this issue Jan 30, 2024
In order to run:

    pip install -e .[docs,tests]

We found that you either need to add a stub setup.py like this or be
using a very recent version of pip. In order to streamline the
installation process on more machines with a relaxed pip version
constraint, this stub is added.

Fixes terrapower#1639.
ntouran added a commit to ntouran/armi that referenced this issue Jan 30, 2024
In order to run:

    pip install -e .[docs,tests]

We found that you either need to add a stub setup.py like this or be
using a very recent version of pip. In order to streamline the
installation process on more machines with a relaxed pip version
constraint, this stub is added.

Fixes terrapower#1639.
@john-science john-science self-assigned this Jan 30, 2024
@ntouran
Copy link
Member Author

ntouran commented Jan 30, 2024

If we really don't want it at all for some reason, then we need to update our documentation and build process to avoid this error for users.

How would you prefer to solve the error shown above?

@john-science
Copy link
Member

So, I can't reproduce this bug locally (Python 3.9.7 and pip==22.1):

$ python --version
Python 3.9.7
$ python -m pip --version
pip 22.1 from \\path\to\venv\lib\site-packages\pip (python 3.9)
$
$ pip install -e .[test]
Looking in indexes: https://devwebsvc1.tp.int/pypi
Obtaining file:///C:/Users/jstilley/codes/repos/armi
...
Successfully built armi
Installing collected packages: armi
  Attempting uninstall: armi
    Found existing installation: armi 0.2.8
    Uninstalling armi-0.2.8:
      Successfully uninstalled armi-0.2.8
Successfully installed armi-0.3.0

However, I think we can prove that this works for pip==23.3.1, because we run this tox.ini file on GitHub CI every day:

armi/tox.ini

Lines 12 to 14 in f6e1c78

[testenv:test]
commands =
pip install -e .[memprof,mpi,test]

in our GitHub "unittest" workflow:

- name: Run Tox
run: tox -e test,mpitest

And that workflow runs on all commits and PRs fine, for all versions of Python, but with a recent version of pip.

So, before I update the docs, I'd like to be able to reproduce your bug so I can add the write info in the docs.

What version of Python were you using when the above failure occurred?

@caiodallaqua
Copy link

Hi there! Unable to reproduce this as well.

By the way, I'd like to suggest using quotes in such commands across the documentation, for shell portability.

Square brackets have special meanings in zsh so pip install -e .[test] breaks there.
Changing it to pip install -e ".[test]" works for zsh, bash and sh.

@john-science john-science changed the title Installation instructions for editable install not working: Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. ARMI cannot be installed in editable mode with pip<22.1 Mar 12, 2024
@john-science john-science linked a pull request Mar 12, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong: Highest Priority documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants