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

build: switch from setup.py to pyproject.toml #1978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afuetterer
Copy link
Contributor

@afuetterer afuetterer commented May 7, 2024

  • adapt pypi command in makefile

See #1969

@@ -14,8 +14,7 @@ docs:
mkdocs serve

pypi:
python setup.py sdist
python setup.py bdist_wheel --universal
python -m build
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have overseen this command in the Makefile before.

The pypi command used the deleted setup.py file, which lead to an error.

I added python -m build instead, which uses the new recommended build tool.

Copy link
Owner

Choose a reason for hiding this comment

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

If I'm not mistaken, using build would require a new pipeline which complicates my process to push it to pypi. Instead, I would suggest following the scikit-lego approach such that the original pipeline would remain intact.

@afuetterer
Copy link
Contributor Author

What do you think?

@MaartenGr
Copy link
Owner

Thanks for the PR and the ping! There are several PRs/issues/discussions open that require my attention so it might take a while before I can explore this PR.

@afuetterer
Copy link
Contributor Author

Of course, sorry. :)

Copy link
Owner

@MaartenGr MaartenGr left a comment

Choose a reason for hiding this comment

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

Left a couple of questions/suggestions that we can go over to make sure the general flow of installation remains the same.

Comment on lines +2 to +3
requires = ["hatchling"]
build-backend = "hatchling.build"
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to be setuptools if we are indeed going back to the original approach of pushing to pypi.


[project]
name = "bertopic"
dynamic = ["version"]
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer an explicit version akin to:

version = "0.16.2"

dynamic = ["version"]
description = "BERTopic performs topic Modeling with state-of-the-art transformer models."
readme = "README.md"
license = {text = "MIT"}
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
license = {text = "MIT"}
license = {file = "LICENSE"}

[project.urls]
Documentation = "https://maartengr.github.io/BERTopic/"
Homepage = "https://github.com/MaartenGr/BERTopic"
"Issue Tracker" = "https://github.com/MaartenGr/BERTopic/issues"
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"Issue Tracker" = "https://github.com/MaartenGr/BERTopic/issues"
Issues = "https://github.com/MaartenGr/BERTopic/issues"

Documentation = "https://maartengr.github.io/BERTopic/"
Homepage = "https://github.com/MaartenGr/BERTopic"
"Issue Tracker" = "https://github.com/MaartenGr/BERTopic/issues"
"Source Code" = "https://github.com/MaartenGr/BERTopic/"
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"Source Code" = "https://github.com/MaartenGr/BERTopic/"
Repository = "https://github.com/MaartenGr/BERTopic.git"

Comment on lines +98 to +101
[tool.hatch.build.targets.sdist]
include = [
"/bertopic",
]
Copy link
Owner

Choose a reason for hiding this comment

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

If setuptools, something like this:

[tool.setuptools.packages.find]
include = ["bertopic*"]
exclude = [
    "docs",
    "images",
    "notebooks",
    "tests",
]

@afuetterer
Copy link
Contributor Author

I will adapt soon.

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.

None yet

2 participants