Skip to content

Conversation

onerandomusername
Copy link
Member

@onerandomusername onerandomusername commented Aug 25, 2025

closes #664

@onerandomusername onerandomusername force-pushed the feat/build-with-hatchling branch 3 times, most recently from f7a43c1 to 27cb9ad Compare August 25, 2025 21:44
@shiftinv shiftinv added t: dependencies Addition/update/removal of dependencies t: meta Changes to the project itself (CI, configs, etc.) labels Aug 26, 2025
@onerandomusername onerandomusername force-pushed the feat/build-with-hatchling branch 2 times, most recently from 0d9175a to e7d0b60 Compare August 27, 2025 02:22
@onerandomusername onerandomusername marked this pull request as ready for review August 27, 2025 07:53
@onerandomusername onerandomusername requested a review from a team as a code owner August 27, 2025 07:53
@onerandomusername onerandomusername force-pushed the feat/build-with-hatchling branch 3 times, most recently from 4eed882 to 2063c20 Compare September 3, 2025 05:03
@onerandomusername onerandomusername force-pushed the feat/build-with-hatchling branch 2 times, most recently from 3785324 to 8a314c4 Compare September 4, 2025 22:52
@onerandomusername onerandomusername force-pushed the feat/build-with-hatchling branch from 8a314c4 to 0294825 Compare September 5, 2025 10:09
Copy link

read-the-docs-community bot commented Sep 20, 2025

Documentation build overview

📚 disnake | 🛠️ Build #29974033 | 📁 Comparing 3fe0fa6 against latest (dba1a62)


🔍 Preview build

Show files changed (49 files in total): 📝 49 modified | ➕ 0 added | ➖ 0 deleted
File Status
genindex.html 📝 modified
index.html 📝 modified
whats_new.html 📝 modified
api/abc.html 📝 modified
api/activities.html 📝 modified
api/app_commands.html 📝 modified
api/app_info.html 📝 modified
api/audit_logs.html 📝 modified
api/automod.html 📝 modified
api/channels.html 📝 modified
api/clients.html 📝 modified
api/components.html 📝 modified
api/emoji.html 📝 modified
api/entitlements.html 📝 modified
api/events.html 📝 modified
api/exceptions.html 📝 modified
api/guild_scheduled_events.html 📝 modified
api/guilds.html 📝 modified
api/integrations.html 📝 modified
api/interactions.html 📝 modified
api/invites.html 📝 modified
api/localization.html 📝 modified
api/members.html 📝 modified
api/messages.html 📝 modified
api/misc.html 📝 modified
api/permissions.html 📝 modified
api/roles.html 📝 modified
api/skus.html 📝 modified
api/soundboard.html 📝 modified
api/stage_instances.html 📝 modified
api/stickers.html 📝 modified
api/subscriptions.html 📝 modified
api/ui.html 📝 modified
api/users.html 📝 modified
api/utilities.html 📝 modified
api/voice.html 📝 modified
api/webhooks.html 📝 modified
api/widgets.html 📝 modified
ext/tasks/index.html 📝 modified
ext/commands/api/app_commands.html 📝 modified
ext/commands/api/bots.html 📝 modified
ext/commands/api/checks.html 📝 modified
ext/commands/api/cogs.html 📝 modified
ext/commands/api/context.html 📝 modified
ext/commands/api/converters.html 📝 modified
ext/commands/api/exceptions.html 📝 modified
ext/commands/api/help_commands.html 📝 modified
ext/commands/api/misc.html 📝 modified
ext/commands/api/prefix_commands.html 📝 modified

Copy link
Member

@shiftinv shiftinv left a comment

Choose a reason for hiding this comment

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

Looks pretty good! I spent some time looking into hatchling + versioningit, but haven't fully reviewed everything just yet, so here are some preliminary comments:

"towncrier==23.6.0",
"sphinx-notfound-page==0.8.3",
"sphinxext-opengraph==0.9.1",
"versioningit>=3.3.0",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"versioningit>=3.3.0",
"versioningit~=3.3",

Copy link
Member Author

Choose a reason for hiding this comment

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

Versioningit is special. It is a build dependency, so it shouldn't be pinned. this matches what we have in build-requires.

Copy link
Member

Choose a reason for hiding this comment

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

build-requires limits it to <4.0, which is what ~=3.3 also effectively does

Copy link
Member Author

Choose a reason for hiding this comment

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

oh. I should undo that.

Copy link
Member

Choose a reason for hiding this comment

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

There might be some merit to specifying an upper bound, since this uses a custom template-fields function:

Moreover, the basic pyproject.toml interface to versioningit can be considered very stable [...]. Nearly all breaking changes will be to the library or custom method API; if you’ve written any code that uses this part of the API, you are advised to declare the next major version of versioningit as an upper bound on your versioningit dependency.

https://versioningit.readthedocs.io/en/stable/notes.html#backwards-compatibility-policy

Comment on lines 22 to +25
# Get the version from the Sphinx config
version = self.env.config.version
self.arguments[0] = version
self.arguments[0] = versioningit.get_next_version(
pathlib.Path(__file__).parent.parent.parent
)
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit like a hack, we could integrate this a little better with

...
    self.arguments[0] = self.env.config.next_version
...
def setup(app):
    app.add_config_value("next_version", None, "env", types=[str])

Copy link
Member

Choose a reason for hiding this comment

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

Now that the version gets inferred and isn't being set manually anymore, I believe all the versiontool.py stuff from this file and create-release-pr.yaml (as well as the script itself) can be removed

Copy link
Member Author

@onerandomusername onerandomusername Oct 17, 2025

Choose a reason for hiding this comment

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

Yeah. I plan to update all of the release pr stuff separately because of the vnext change that also needs to be implemented

Changelog generation and vnext fixing needs to be committed, then tagged.

But I'll be doing this in another pull.

]


[tool.check-manifest]
Copy link
Member

Choose a reason for hiding this comment

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

We obviously don't have a MANIFEST.in anymore, but could it be worth considering finding a replacement for check-manifest somehow, that at least checks the sdist against a preset list of files we expect in there?

Comment on lines +124 to +126
include = [
"disnake/",
]
Copy link
Member

Choose a reason for hiding this comment

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

perhaps worth noting a tiny issue. there doesn't seem to be a single python file in the built wheel besides _version.py:
image

Seems like the sdist include below is overwriting the global include.

Comment on lines +144 to +147
[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+d{build_date:%Y%m%d}"
distance-dirty = "{base_version}.a{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
Copy link
Member

Choose a reason for hiding this comment

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

These don't quite match, making builds of dirty trees use a slightly different format:

clean: disnake-2.11.0+66.g3fe0fa63-py3-none-any.whl
dirty: disnake-2.11.0a66+g3fe0fa63.d20251017-py3-none-any.whl

(note the +66 vs a66)

params: Dict[str, Any],
) -> Dict[str, Any]:
"""Implements the ``"basic"`` ``template-fields`` method"""
params = copy.deepcopy(params)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
params = copy.deepcopy(params)

appears to be unused

Comment on lines +137 to +139
[tool.versioningit]
default-version = "0.0.0"

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[tool.versioningit]
default-version = "0.0.0"

If anything goes catastrophically wrong I'd rather know about it, having a default version set will essentially ignore any errors

}

if parsed_version.pre:
releaselevel = releaselevels.get(parsed_version.pre[0], "final")
Copy link
Member

Choose a reason for hiding this comment

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

pre[0] won't work for rc versions

Comment on lines +22 to +28
if description is not None:
fields.update(description.fields)
fields["branch"] = description.branch
if base_version is not None:
fields["base_version"] = base_version
if next_version is not None:
fields["next_version"] = next_version
Copy link
Member

Choose a reason for hiding this comment

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

The template only uses {version} and {version_template}, are these actually needed here?

Comment on lines +50 to +53
try:
fields["normalized_version"] = str(packaging.version.Version(version))
except ValueError:
fields["normalized_version"] = version
Copy link
Member

Choose a reason for hiding this comment

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

+1, see previous comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t: dependencies Addition/update/removal of dependencies t: meta Changes to the project itself (CI, configs, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider dropping setuptools

2 participants