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

usedevelop without setup.py failure #2197

Closed
AntoineD opened this issue Sep 2, 2021 · 19 comments · Fixed by #2273
Closed

usedevelop without setup.py failure #2197

AntoineD opened this issue Sep 2, 2021 · 19 comments · Fixed by #2273
Labels
bug:normal affects many people or has quite an impact

Comments

@AntoineD
Copy link
Contributor

AntoineD commented Sep 2, 2021

When usedevelop is enabled with a project that only has a setup.cfg but no setup.py, on the second tox execution with no changes at all, tox crashes because VirtualEnv._needs_reinstall relies on setup.py to get the name of the project's package.

A PR is coming next.

@AntoineD AntoineD added the bug:normal affects many people or has quite an impact label Sep 2, 2021
@gaborbernat
Copy link
Member

I don't think it's possible to use usedevelop without a setup.py. How does this even passes at first run?

@AntoineD
Copy link
Contributor Author

AntoineD commented Sep 2, 2021

I don't think it's possible to use usedevelop without a setup.py. How does this even passes at first run?

This happens with an env that does not run the tests, I'll see what happens otherwise.

@AntoineD
Copy link
Contributor Author

AntoineD commented Sep 2, 2021

This works fine when running pytest in the commands of the such an env.

@gaborbernat What do you mean by not possible?

@gaborbernat
Copy link
Member

gaborbernat commented Sep 2, 2021

usedevelop implies the installation of the package via setup.py. The installation will fail without setup.py.

@AntoineD
Copy link
Contributor Author

AntoineD commented Sep 2, 2021

From what I can see, the installation works fine with only setup.cfg and no setup.py when usedevelop = True.

Have you tried?

@gaborbernat
Copy link
Member

Hmm, did setuptools and pip change this? Can you dig up from pip+setuptools changelog when this was added? I know a while back you could not install in develop mode a package, because the interface was the setup.py file itself. It might work now but we need to figure out what versions of pip+setuptools require that 🤔

@AntoineD
Copy link
Contributor Author

AntoineD commented Sep 2, 2021

The failures of the PR's CI's jobs seems to be related to what you are saying. Things behave differently on my PC, I'll dig up.

@AntoineD
Copy link
Contributor Author

AntoineD commented Sep 2, 2021

This has been fixed in pip 21.1.

@posita
Copy link
Contributor

posita commented Sep 11, 2021

Just curious, but what's the fix here? Tox should require pip>=21.1?

@AntoineD
Copy link
Contributor Author

@posita Yes (not considering tox).

@posita
Copy link
Contributor

posita commented Sep 11, 2021

A PR is coming next.

Is this still true, or should this be closed without a fix?

@AntoineD
Copy link
Contributor Author

The PR has been closed without merge.

@posita
Copy link
Contributor

posita commented Sep 18, 2021

I don't think pip fixes this. I still see this with pip==21.2.4.

Digging into this a bit, this works (including on the second and subsequent runs):

[tox]
#
skipsdist = true

[testenv]
#
deps =
    --editable .  # <-- this works

This fails on the second run (per the OP):

[tox]
#
skipsdist = true

[testenv]
#
usedevelop = True  # <-- this works once, then fails on subsequent runs

posita added a commit to posita/test-case-for-tox-2197 that referenced this issue Sep 18, 2021
@posita
Copy link
Contributor

posita commented Sep 18, 2021

Here's a test case: posita/test-case-for-tox-2197.

$ tox -e py39,py39-workaround  # first run
#
  py39: commands succeeded
  py39-workaround: commands succeeded
  congratulations :)
$ tox -e py39,py39-workaround  # second run
#
ERROR:   py39: InvocationError for command /private/tmp/foo/.tox/py39/bin/python /private/tmp/foo/setup.py --name (exited with code 2)
  py39-workaround: commands succeeded

posita added a commit to posita/test-case-for-tox-2197 that referenced this issue Sep 18, 2021
@ssbarnea
Copy link
Member

ssbarnea commented Nov 2, 2021

I am quite interested about fixing this because I already started to remove the historical setup.py from most projects since pip started to allow editable installs without it.

@webknjaz
Copy link
Contributor

webknjaz commented Nov 2, 2021

I don't think pip fixes this. I still see this with pip==21.2.4.

Pip does fix pip install -e . but it's not what tox uses IIRC. I think tox attempts invoking the deprecated1 setup.py develop

Footnotes

  1. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for the details.

@ssbarnea
Copy link
Member

ssbarnea commented Nov 2, 2021

I spent the last couple of hours trying to keep coverage working while dropping the broken usedevelop and switching to --editable . but without any luck so far.

Apparently almost all repo setups I found implement coverage using tox editable installs. Shortly I cannot drop setup.py without breaking coverage. Did anyone managed to find a configuration where this still works?

ssbarnea added a commit to ssbarnea/ansible-compat that referenced this issue Nov 2, 2021
@gaborbernat
Copy link
Member

ssbarnea added a commit to ssbarnea/ansible-compat that referenced this issue Nov 2, 2021
ssbarnea added a commit to ssbarnea/ansible-compat that referenced this issue Nov 2, 2021
ssbarnea added a commit to ssbarnea/ansible-compat that referenced this issue Nov 2, 2021
@ssbarnea
Copy link
Member

ssbarnea commented Nov 2, 2021

In the end I was able to make it work with ansible/ansible-compat#96 I no longer use pytest-cov as running coverage ... is more reliable.

I am really glad we have a workaround.

VincentVanlaer added a commit to VincentVanlaer/tox that referenced this issue Nov 13, 2021
The detection logic for figuring out whether a editable install needs to
be reinstalled only works for setuptools based builds using setup.py.
If setup.py cannot be found the code will fail with an invocation error.
Currently no standard mechanism exists to query a package installed in
editable mode whether it should be reinstalled or not. Hence, this
change skips reinstallation if setup.py cannot be found.

Fixes tox-dev#2197
ssbarnea added a commit to ssbarnea/molecule that referenced this issue Nov 25, 2021
ssbarnea added a commit to ssbarnea/molecule that referenced this issue Nov 25, 2021
ssbarnea added a commit to ssbarnea/molecule that referenced this issue Nov 25, 2021
ssbarnea added a commit to ansible/molecule that referenced this issue Nov 25, 2021
gaborbernat pushed a commit to VincentVanlaer/tox that referenced this issue Dec 28, 2021
The detection logic for figuring out whether a editable install needs to
be reinstalled only works for setuptools based builds using setup.py.
If setup.py cannot be found the code will fail with an invocation error.
Currently no standard mechanism exists to query a package installed in
editable mode whether it should be reinstalled or not. Hence, this
change skips reinstallation if setup.py cannot be found.

Fixes tox-dev#2197
bors bot added a commit to meilisearch/meilisearch-python that referenced this issue Dec 29, 2021
379: Bump tox from 3.24.4 to 3.24.5 r=alallema a=dependabot[bot]

Bumps [tox](https:/tox-dev/tox) from 3.24.4 to 3.24.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https:/tox-dev/tox/blob/master/docs/changelog.rst">tox's changelog</a>.</em></p>
<blockquote>
<p>v3.24.5 (2021-12-29)
Bugfixes
^^^^^^^^</p>
<ul>
<li>Fixed an issue where <code>usedevelop</code> would cause an invocation error if setup.py does not exist. -- by :user:<code>VincentVanlaer</code>
<code>[#2197](tox-dev/tox#2197) &lt;https:/tox-dev/tox/issues/2197&gt;</code>_</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https:/tox-dev/tox/commit/8cf6330195c078545bcbff52c8d31df12da9944f"><code>8cf6330</code></a> release 3.24.5</li>
<li><a href="https:/tox-dev/tox/commit/72e239141d7fbe9f16093f7e1a861eb69ea7e451"><code>72e2391</code></a> Do not reinstall in develop mode without setup.py (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2273">#2273</a>)</li>
<li><a href="https:/tox-dev/tox/commit/0985677b6a934c9698a5b9e948417560903889b3"><code>0985677</code></a> Move CI to Github Actions (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2293">#2293</a>)</li>
<li><a href="https:/tox-dev/tox/commit/717b7644a2376c0178ad293c41c76ff6631bdc46"><code>717b764</code></a> Fix typos (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2253">#2253</a>)</li>
<li><a href="https:/tox-dev/tox/commit/4cf816c97de18dca9d99dc86fec341c1d2c4a20a"><code>4cf816c</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2248">#2248</a>)</li>
<li><a href="https:/tox-dev/tox/commit/30dbb40f7cce82001b9c269248184057092002dc"><code>30dbb40</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2246">#2246</a>)</li>
<li><a href="https:/tox-dev/tox/commit/5f2aaf0afbf1d4887b06cebff7acf14c2ed29cad"><code>5f2aaf0</code></a> Declare support for Python 3.10 and update links (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2221">#2221</a>)</li>
<li><a href="https:/tox-dev/tox/commit/fed6e7a59158412efc91fdde260b69e698a1d091"><code>fed6e7a</code></a> [pre-commit.ci] pre-commit autoupdate</li>
<li><a href="https:/tox-dev/tox/commit/a2370f4ad055cb5d570745d3a06016a7ea76d6cb"><code>a2370f4</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2228">#2228</a>)</li>
<li><a href="https:/tox-dev/tox/commit/59742ec427bf97cf08eface32c7a58ca8f5c5926"><code>59742ec</code></a> Update changelog.rst</li>
<li>Additional commits viewable in <a href="https:/tox-dev/tox/compare/3.24.4...3.24.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tox&package-manager=pip&previous-version=3.24.4&new-version=3.24.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
mergify bot pushed a commit to andrewbolster/bolster that referenced this issue Dec 29, 2021
Bumps [tox](https:/tox-dev/tox) from 3.24.4 to 3.24.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https:/tox-dev/tox/blob/master/docs/changelog.rst">tox's changelog</a>.</em></p>
<blockquote>
<p>v3.24.5 (2021-12-29)
Bugfixes
^^^^^^^^</p>
<ul>
<li>Fixed an issue where <code>usedevelop</code> would cause an invocation error if setup.py does not exist. -- by :user:<code>VincentVanlaer</code>
<code>[#2197](tox-dev/tox#2197) &lt;https:/tox-dev/tox/issues/2197&gt;</code>_</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https:/tox-dev/tox/commit/8cf6330195c078545bcbff52c8d31df12da9944f"><code>8cf6330</code></a> release 3.24.5</li>
<li><a href="https:/tox-dev/tox/commit/72e239141d7fbe9f16093f7e1a861eb69ea7e451"><code>72e2391</code></a> Do not reinstall in develop mode without setup.py (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2273">#2273</a>)</li>
<li><a href="https:/tox-dev/tox/commit/0985677b6a934c9698a5b9e948417560903889b3"><code>0985677</code></a> Move CI to Github Actions (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2293">#2293</a>)</li>
<li><a href="https:/tox-dev/tox/commit/717b7644a2376c0178ad293c41c76ff6631bdc46"><code>717b764</code></a> Fix typos (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2253">#2253</a>)</li>
<li><a href="https:/tox-dev/tox/commit/4cf816c97de18dca9d99dc86fec341c1d2c4a20a"><code>4cf816c</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2248">#2248</a>)</li>
<li><a href="https:/tox-dev/tox/commit/30dbb40f7cce82001b9c269248184057092002dc"><code>30dbb40</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2246">#2246</a>)</li>
<li><a href="https:/tox-dev/tox/commit/5f2aaf0afbf1d4887b06cebff7acf14c2ed29cad"><code>5f2aaf0</code></a> Declare support for Python 3.10 and update links (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2221">#2221</a>)</li>
<li><a href="https:/tox-dev/tox/commit/fed6e7a59158412efc91fdde260b69e698a1d091"><code>fed6e7a</code></a> [pre-commit.ci] pre-commit autoupdate</li>
<li><a href="https:/tox-dev/tox/commit/a2370f4ad055cb5d570745d3a06016a7ea76d6cb"><code>a2370f4</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2228">#2228</a>)</li>
<li><a href="https:/tox-dev/tox/commit/59742ec427bf97cf08eface32c7a58ca8f5c5926"><code>59742ec</code></a> Update changelog.rst</li>
<li>Additional commits viewable in <a href="https:/tox-dev/tox/compare/3.24.4...3.24.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tox&package-manager=pip&previous-version=3.24.4&new-version=3.24.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
bors bot added a commit to meilisearch/docs-scraper that referenced this issue Feb 11, 2022
180: Bump tox from 3.24.3 to 3.24.5 r=brunoocasali a=dependabot[bot]

Bumps [tox](https:/tox-dev/tox) from 3.24.3 to 3.24.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https:/tox-dev/tox/blob/master/docs/changelog.rst">tox's changelog</a>.</em></p>
<blockquote>
<p>v3.24.5 (2021-12-29)
Bugfixes
^^^^^^^^</p>
<ul>
<li>Fixed an issue where <code>usedevelop</code> would cause an invocation error if setup.py does not exist. -- by :user:<code>VincentVanlaer</code>
<code>[#2197](tox-dev/tox#2197) &lt;https:/tox-dev/tox/issues/2197&gt;</code>_</li>
</ul>
<h2>v3.24.4 (2021-09-16)</h2>
<p>Bugfixes
^^^^^^^^</p>
<ul>
<li>Fixed handling of <code>-e ALL</code> in parallel mode by ignoring the <code>ALL</code> in subprocesses -- by :user:<code>guahki</code>.
<code>[#2167](tox-dev/tox#2167) &lt;https:/tox-dev/tox/issues/2167&gt;</code>_</li>
<li>Prevent tox from using a truncated interpreter when using
<code>TOX_LIMITED_SHEBANG</code> -- by :user:<code>jdknight</code>.
<code>[#2208](tox-dev/tox#2208) &lt;https:/tox-dev/tox/issues/2208&gt;</code>_</li>
</ul>
<p>Documentation
^^^^^^^^^^^^^</p>
<ul>
<li>Enabled the use of the favicon in the Sphinx docs first
introduced in :pull:<code>764</code> but not integrated fully
-- :user:<code>webknjaz</code>
<code>[#2177](tox-dev/tox#2177) &lt;https:/tox-dev/tox/issues/2177&gt;</code>_</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https:/tox-dev/tox/commit/8cf6330195c078545bcbff52c8d31df12da9944f"><code>8cf6330</code></a> release 3.24.5</li>
<li><a href="https:/tox-dev/tox/commit/72e239141d7fbe9f16093f7e1a861eb69ea7e451"><code>72e2391</code></a> Do not reinstall in develop mode without setup.py (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2273">#2273</a>)</li>
<li><a href="https:/tox-dev/tox/commit/0985677b6a934c9698a5b9e948417560903889b3"><code>0985677</code></a> Move CI to Github Actions (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2293">#2293</a>)</li>
<li><a href="https:/tox-dev/tox/commit/717b7644a2376c0178ad293c41c76ff6631bdc46"><code>717b764</code></a> Fix typos (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2253">#2253</a>)</li>
<li><a href="https:/tox-dev/tox/commit/4cf816c97de18dca9d99dc86fec341c1d2c4a20a"><code>4cf816c</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2248">#2248</a>)</li>
<li><a href="https:/tox-dev/tox/commit/30dbb40f7cce82001b9c269248184057092002dc"><code>30dbb40</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2246">#2246</a>)</li>
<li><a href="https:/tox-dev/tox/commit/5f2aaf0afbf1d4887b06cebff7acf14c2ed29cad"><code>5f2aaf0</code></a> Declare support for Python 3.10 and update links (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2221">#2221</a>)</li>
<li><a href="https:/tox-dev/tox/commit/fed6e7a59158412efc91fdde260b69e698a1d091"><code>fed6e7a</code></a> [pre-commit.ci] pre-commit autoupdate</li>
<li><a href="https:/tox-dev/tox/commit/a2370f4ad055cb5d570745d3a06016a7ea76d6cb"><code>a2370f4</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/tox-dev/tox/issues/2228">#2228</a>)</li>
<li><a href="https:/tox-dev/tox/commit/59742ec427bf97cf08eface32c7a58ca8f5c5926"><code>59742ec</code></a> Update changelog.rst</li>
<li>Additional commits viewable in <a href="https:/tox-dev/tox/compare/3.24.3...3.24.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tox&package-manager=pip&previous-version=3.24.3&new-version=3.24.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:normal affects many people or has quite an impact
Projects
None yet
5 participants