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

Switch to flit #394

Closed
layday opened this issue Oct 23, 2021 · 11 comments · Fixed by #471
Closed

Switch to flit #394

layday opened this issue Oct 23, 2021 · 11 comments · Fixed by #471
Labels
enhancement New feature or request question Further information is requested

Comments

@layday
Copy link
Member

layday commented Oct 23, 2021

After #393, our two remaining required dependencies will both be using flit as their build backend. Switching to flit would eliminate two build dependencies (setuptools and wheel) and will simplify bootstrapping build without setuptools. Flit is also able to generate a setup.py from its metadata which we can version for setuptools holdouts.

@FFY00 FFY00 added enhancement New feature or request question Further information is requested labels Oct 23, 2021
@takluyver
Copy link
Member

To be transparent, I'm planning for Flit to move away from generating setup.py. It might be a while before the ability is actually removed, but I'm thinking of disabling it by default in the next release. So don't rely on that in the longer term. However, it shouldn't be much effort to maintain a minimal setup.py - just enough to get the package installed - by hand if you feel that's necessary.

@henryiii
Copy link
Contributor

The wheels still work, so I'd not worry about legacy setup.py's too much. Guessing a few distro packaging systems might like it, but other than that, it's probably not useful.

@layday
Copy link
Member Author

layday commented Oct 30, 2021

We should not remove setup.py at least not before installer has a CLI.

@henryiii
Copy link
Contributor

https://pypi.org/project/installer/, I assume. Designed to allow distributions and such to use pure-python wheels instead of SDists?

@layday
Copy link
Member Author

layday commented Oct 30, 2021

The point is that the only other way to install a wheel is by using pip which a lot of distros cannot stomach. installer is meant to provide a lightweight alternative to that. Up till now, the most common way to bootstrap Python is using setuptools, and relying on foundational dependencies to be setup.py-installable.

@astrojuanlu
Copy link

at least not before installer has a CLI

xref https://github.com/pradyunsg/installer/issues/52

@pradyunsg
Copy link
Member

With installer getting a CLI (https://installer.readthedocs.io/en/latest/cli/installer/) and flit_core getting better bootstrapping story pretty soon (pypa/flit#511), I think this is now unblocked for moving to flit.

I think migrating to flit would also bring a fairly clean boostrapping story as well.

  • Build and install flit_core, through flit_core's boostrappers.
  • Build installer with flit_core, and install with flit_core's bootstrapper.
  • Build build with flit_core, and install with installer.
  • You have build and installer installed, and ready for use.
  • python -m build . && python -m installer ./dist/*.whl will install the project in cwd into the running Python version.

@takluyver
Copy link
Member

Build installer with flit_core, and install with flit_core's bootstrapper.

And install with installer itself (running from source)? At least, this is my assumption for how it should work. The bootstrap_install.py script for flit_core is only meant to be for installing flit_core itself, and currently it checks that the filename starts with flit_core-.

There are a few more intermediate steps for build's dependencies - packaging, tomli and pep517 (/your pyproject-hooks fork) - but if packaging switches to Flit again as I think was planned, then they can all be built with flit_core and installed with installer, so there's no extra complexity there, just doing the same thing a couple more times.

Other than that, 👍

@vishwin
Copy link

vishwin commented Apr 10, 2022

flit_core is absolutely self-bootstrapping now. installer installs itself after flit_core generates the wheel in installer's working copy.

if packaging switches to Flit again as I think was planned, then they can all be built with flit_core and installed with installer,

I've nudged at pypa/packaging#340.

@nanonyme
Copy link

nanonyme commented Oct 19, 2022

Packaging has now switched to flit. No release done though. pyparsing dependency from packaging is gone.

@nanonyme
Copy link

nanonyme commented Oct 19, 2022

@pradyunsg how we ended doing bootstrapping is we (with PYTHONPATH) use installer to install wheel of itself. It works fine. Then we don't need to use flit_core bootstrap install to install anything else than flit_core. (I think it doesn't even support by design anything else)

inmantaci pushed a commit to inmanta/inmanta-core that referenced this issue Jan 12, 2023
Bumps [build](https://github.com/pypa/build) from 0.9.0 to 0.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/build/blob/main/CHANGELOG.rst">build's changelog</a>.</em></p>
<blockquote>
<h1>0.10.0 (2023-01-11)</h1>
<ul>
<li>Replace <code>pep517</code> dependency with <code>pyproject_hooks</code>,
into which <code>pep517</code> has been renamed
(<code>PR [#539](https://github.com/pypa/build/issues/539)</code><em>, Fixes <code>[#529](https://github.com/pypa/build/issues/529)</code></em>)</li>
<li>Change build backend from <code>setuptools</code> to <code>flit</code>
(<code>PR [#470](https://github.com/pypa/build/issues/470)</code><em>, Fixes <code>[#394](https://github.com/pypa/build/issues/394)</code></em>)</li>
<li>Dropped support for Python 3.6 (<code>PR [#532](https://github.com/pypa/build/issues/532)</code>_)</li>
</ul>
<p>.. _PR <a href="https://github-redirect.dependabot.com/pypa/build/issues/470">#470</a>: <a href="https://github-redirect.dependabot.com/pypa/build/pull/470">pypa/build#470</a>
.. _PR <a href="https://github-redirect.dependabot.com/pypa/build/issues/532">#532</a>: <a href="https://github-redirect.dependabot.com/pypa/build/pull/532">pypa/build#532</a>
.. _<a href="https://github-redirect.dependabot.com/pypa/build/issues/394">#394</a>: <a href="https://github-redirect.dependabot.com/pypa/build/issues/394">pypa/build#394</a>
.. _PR <a href="https://github-redirect.dependabot.com/pypa/build/issues/539">#539</a>: <a href="https://github-redirect.dependabot.com/pypa/build/pull/539">pypa/build#539</a>
.. _<a href="https://github-redirect.dependabot.com/pypa/build/issues/529">#529</a>: <a href="https://github-redirect.dependabot.com/pypa/build/issues/529">pypa/build#529</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/build/commit/cd06da25481b9a610f846fa60cb67b5a5fa9a051"><code>cd06da2</code></a> release 0.10.0</li>
<li><a href="https://github.com/pypa/build/commit/9646f6890371c3efe61c09d138ed401a48cc618d"><code>9646f68</code></a> pre-commit: bump repositories (<a href="https://github-redirect.dependabot.com/pypa/build/issues/555">#555</a>)</li>
<li><a href="https://github.com/pypa/build/commit/c99f58ccb59b83736a4be5cdbd3a6da16c4d6c8f"><code>c99f58c</code></a> build: pep517 -&gt; pyproject-hooks (upstream project renamed) (<a href="https://github-redirect.dependabot.com/pypa/build/issues/539">#539</a>)</li>
<li><a href="https://github.com/pypa/build/commit/76d90b997f6e1db07d9c57b30f8b45e051afb922"><code>76d90b9</code></a> tests: fix for PEP 685 in packaging 22 (<a href="https://github-redirect.dependabot.com/pypa/build/issues/550">#550</a>)</li>
<li><a href="https://github.com/pypa/build/commit/656c48720f4c6d92a0d05aed41f17d8133d079c3"><code>656c487</code></a> pre-commit: bump repositories</li>
<li><a href="https://github.com/pypa/build/commit/e1612730c8ab56fab1e6b0355fb603b92cf762dd"><code>e161273</code></a> pre-commit: bump repositories</li>
<li><a href="https://github.com/pypa/build/commit/b8a1384d87575c1ea1781f3154366eb642161dd4"><code>b8a1384</code></a> ci: introduce a centralized GHA check/gate job (<a href="https://github-redirect.dependabot.com/pypa/build/issues/543">#543</a>)</li>
<li><a href="https://github.com/pypa/build/commit/a7617f8e8f4b91c7ecd535937027d706d41686f9"><code>a7617f8</code></a> types: fix mypy check</li>
<li><a href="https://github.com/pypa/build/commit/4475cf1bf2362cfba8dd8b10ac97b42d066db502"><code>4475cf1</code></a> pre-commit: bump repositories</li>
<li><a href="https://github.com/pypa/build/commit/3e7dc60e779cf95e793b02363e643556f61ed74a"><code>3e7dc60</code></a> pre-commit: add validate-pyproject</li>
<li>Additional commits viewable in <a href="https://github.com/pypa/build/compare/0.9.0...0.10.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=build&package-manager=pip&previous-version=0.9.0&new-version=0.10.0)](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>
github-actions bot added a commit to MaRDI4NFDI/open-interfaces that referenced this issue Jan 16, 2023
Bumps [build](https://github.com/pypa/build) from 0.9.0 to 0.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/build/blob/main/CHANGELOG.rst">build's
changelog</a>.</em></p>
<blockquote>
<h1>0.10.0 (2023-01-11)</h1>
<ul>
<li>Replace <code>pep517</code> dependency with
<code>pyproject_hooks</code>,
into which <code>pep517</code> has been renamed
(<code>PR [#539](https://github.com/pypa/build/issues/539)</code><em>,
Fixes
<code>[#529](https://github.com/pypa/build/issues/529)</code></em>)</li>
<li>Change build backend from <code>setuptools</code> to
<code>flit</code>
(<code>PR [#470](https://github.com/pypa/build/issues/470)</code><em>,
Fixes
<code>[#394](https://github.com/pypa/build/issues/394)</code></em>)</li>
<li>Dropped support for Python 3.6 (<code>PR
[#532](https://github.com/pypa/build/issues/532)</code>_)</li>
</ul>
<p>.. _PR <a
href="https://github-redirect.dependabot.com/pypa/build/issues/470">#470</a>:
<a
href="https://github-redirect.dependabot.com/pypa/build/pull/470">pypa/build#470</a>
.. _PR <a
href="https://github-redirect.dependabot.com/pypa/build/issues/532">#532</a>:
<a
href="https://github-redirect.dependabot.com/pypa/build/pull/532">pypa/build#532</a>
.. _<a
href="https://github-redirect.dependabot.com/pypa/build/issues/394">#394</a>:
<a
href="https://github-redirect.dependabot.com/pypa/build/issues/394">pypa/build#394</a>
.. _PR <a
href="https://github-redirect.dependabot.com/pypa/build/issues/539">#539</a>:
<a
href="https://github-redirect.dependabot.com/pypa/build/pull/539">pypa/build#539</a>
.. _<a
href="https://github-redirect.dependabot.com/pypa/build/issues/529">#529</a>:
<a
href="https://github-redirect.dependabot.com/pypa/build/issues/529">pypa/build#529</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pypa/build/commit/cd06da25481b9a610f846fa60cb67b5a5fa9a051"><code>cd06da2</code></a>
release 0.10.0</li>
<li><a
href="https://github.com/pypa/build/commit/9646f6890371c3efe61c09d138ed401a48cc618d"><code>9646f68</code></a>
pre-commit: bump repositories (<a
href="https://github-redirect.dependabot.com/pypa/build/issues/555">#555</a>)</li>
<li><a
href="https://github.com/pypa/build/commit/c99f58ccb59b83736a4be5cdbd3a6da16c4d6c8f"><code>c99f58c</code></a>
build: pep517 -&gt; pyproject-hooks (upstream project renamed) (<a
href="https://github-redirect.dependabot.com/pypa/build/issues/539">#539</a>)</li>
<li><a
href="https://github.com/pypa/build/commit/76d90b997f6e1db07d9c57b30f8b45e051afb922"><code>76d90b9</code></a>
tests: fix for PEP 685 in packaging 22 (<a
href="https://github-redirect.dependabot.com/pypa/build/issues/550">#550</a>)</li>
<li><a
href="https://github.com/pypa/build/commit/656c48720f4c6d92a0d05aed41f17d8133d079c3"><code>656c487</code></a>
pre-commit: bump repositories</li>
<li><a
href="https://github.com/pypa/build/commit/e1612730c8ab56fab1e6b0355fb603b92cf762dd"><code>e161273</code></a>
pre-commit: bump repositories</li>
<li><a
href="https://github.com/pypa/build/commit/b8a1384d87575c1ea1781f3154366eb642161dd4"><code>b8a1384</code></a>
ci: introduce a centralized GHA check/gate job (<a
href="https://github-redirect.dependabot.com/pypa/build/issues/543">#543</a>)</li>
<li><a
href="https://github.com/pypa/build/commit/a7617f8e8f4b91c7ecd535937027d706d41686f9"><code>a7617f8</code></a>
types: fix mypy check</li>
<li><a
href="https://github.com/pypa/build/commit/4475cf1bf2362cfba8dd8b10ac97b42d066db502"><code>4475cf1</code></a>
pre-commit: bump repositories</li>
<li><a
href="https://github.com/pypa/build/commit/3e7dc60e779cf95e793b02363e643556f61ed74a"><code>3e7dc60</code></a>
pre-commit: add validate-pyproject</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/build/compare/0.9.0...0.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=build&package-manager=pip&previous-version=0.9.0&new-version=0.10.0)](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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants