Skip to content

remove setup.py and migrate to a static pyproject.toml#388

Merged
twm merged 15 commits intotrunkfrom
no-more-setup-py
Feb 16, 2025
Merged

remove setup.py and migrate to a static pyproject.toml#388
twm merged 15 commits intotrunkfrom
no-more-setup-py

Conversation

@glyph
Copy link
Copy Markdown
Member

@glyph glyph commented Jun 19, 2024

Remove setup.py and migrate project metadata to a static pyproject.toml .

@glyph glyph marked this pull request as draft June 19, 2024 07:05
pyproject.toml Outdated
Comment on lines +6 to +11
# What follows is an exact copy of the runtime dependencies, because (A)
# incremental needs to be able to import `treq` to be able to import
# `treq.__version__` (see `tools.setuptools.dynamic` below), and (B) the
# `treq` module is set up such that everything is eagerly imported into the
# top-level namespace and thus sucks in every other dependency that we
# require.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml Outdated
Comment on lines +81 to +82
[tool.setuptools.dynamic]
version = {attr = "treq.__version__"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, you've tried to use setuptools attr and it's falling back to importing the module.

I don't see anything here equivalent to the use_incremental=True argument to setup(). It looks like we need to add support to incremental for direct integration with setuptools, like setuptools_scm has:

https://github.com/pypa/setuptools_scm/blob/102f56a896bc4ea8d4c58d9c49f455f15310de38/pyproject.toml#L76-L77

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed twisted/incremental#90 for this so that we can fix it in incremental. Sad that this seems to be the main setuptools build extension entrypoint.

@twm
Copy link
Copy Markdown
Member

twm commented Sep 16, 2024

@glyph Do you have any plan to revive this now that Incremental supports pyproject.toml?

@glyph
Copy link
Copy Markdown
Member Author

glyph commented Sep 19, 2024

@glyph Do you have any plan to revive this now that Incremental supports pyproject.toml?

Thanks for the heads up, I would definitely like for this to be landed.

@twm twm force-pushed the no-more-setup-py branch from ed8109a to 3fea904 Compare February 15, 2025 21:30
@twm twm force-pushed the no-more-setup-py branch from 3fea904 to 630c06d Compare February 15, 2025 21:31
twm added 2 commits February 15, 2025 13:34
- Stop pinning an old Sphinx
- Add project URLs based on twisted/twisted
@twm
Copy link
Copy Markdown
Member

twm commented Feb 15, 2025

Closing the circle here, I have further updated the package to use Incremental's Hatchling plugin.

@twm twm marked this pull request as ready for review February 15, 2025 21:50
@twm twm requested a review from a team February 15, 2025 23:05
Copy link
Copy Markdown
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@twm
Copy link
Copy Markdown
Member

twm commented Feb 16, 2025

Thank you for the review @adiroiban!

@twm twm merged commit 8921e20 into trunk Feb 16, 2025
18 checks passed
@twm twm deleted the no-more-setup-py branch February 16, 2025 08:26
sandhose pushed a commit to element-hq/synapse that referenced this pull request Jul 2, 2025
Bumps [treq](https://github.com/twisted/treq) from 24.9.1 to 25.5.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/twisted/treq/blob/trunk/CHANGELOG.rst">treq's
changelog</a>.</em></p>
<blockquote>
<h1>25.5.0 (2025-05-31)</h1>
<h2>Features</h2>
<ul>
<li>treq is packaged with Hatchling, and consequently no longer directly
depends on setuptools.
(<code>[#388](twisted/treq#388)
&lt;https://github.com/twisted/treq/issues/388&gt;</code>__)</li>
</ul>
<h2>Improved Documentation</h2>
<ul>
<li>Update documentation to use <code>async</code>/<code>await</code>
syntax (<code>[#409](twisted/treq#409)
&lt;https://github.com/twisted/treq/issues/409&gt;</code>__)</li>
</ul>
<h2>Deprecations and Removals</h2>
<ul>
<li>Support for Python 3.8, which has reached end of support, is
deprecated. This is the last release with support for Python 3.8.
(<code>[#407](twisted/treq#407)
&lt;https://github.com/twisted/treq/issues/407&gt;</code>__)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/twisted/treq/commit/6869fa5d09f306e2fa225428516f947da0b8fae7"><code>6869fa5</code></a>
Merge pull request <a
href="https://redirect.github.com/twisted/treq/issues/410">#410</a> from
twisted/release-25.5.0</li>
<li><a
href="https://github.com/twisted/treq/commit/56266566cfa71fc2a92ba5c9ace90c43ac774170"><code>5626656</code></a>
Test with Python 3.13 final</li>
<li><a
href="https://github.com/twisted/treq/commit/f10185e4da4b404fa7592a7d948b6d573a9819da"><code>f10185e</code></a>
Generate the changelog</li>
<li><a
href="https://github.com/twisted/treq/commit/4b846664f18261a666ad1bd6de4b59dd67db1fc5"><code>4b84666</code></a>
Version 25.5.0</li>
<li><a
href="https://github.com/twisted/treq/commit/72a4441f599ac93c6a6a78a398366c103db6fb05"><code>72a4441</code></a>
Merge pull request <a
href="https://redirect.github.com/twisted/treq/issues/409">#409</a> from
twisted/rtd-shiny</li>
<li><a
href="https://github.com/twisted/treq/commit/0a814edd8a6927e1c5288500ac98ee457cb53a9e"><code>0a814ed</code></a>
Add changefragment</li>
<li><a
href="https://github.com/twisted/treq/commit/993cc47df5ae415dcb361f1215d9c50c31be6983"><code>993cc47</code></a>
Fix changelog warnings</li>
<li><a
href="https://github.com/twisted/treq/commit/3992177456df67811d0960160ce0c343d1969926"><code>3992177</code></a>
Link to CookieJar</li>
<li><a
href="https://github.com/twisted/treq/commit/cff43d93b6fbb6ce68f7721938906573b6ba55ad"><code>cff43d9</code></a>
Update source_suffix conf</li>
<li><a
href="https://github.com/twisted/treq/commit/e39c8511b12c0cf809c6bc3e22f031597ad27067"><code>e39c851</code></a>
async def print_response</li>
<li>Additional commits viewable in <a
href="https://github.com/twisted/treq/compare/treq-24.9.1...treq-25.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=treq&package-manager=pip&previous-version=24.9.1&new-version=25.5.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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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>

Signed-off-by: dependabot[bot] <support@github.com>
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants