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

Change from setup.cfg to pyproject.toml #73

Merged
merged 6 commits into from
Nov 9, 2023
Merged

Change from setup.cfg to pyproject.toml #73

merged 6 commits into from
Nov 9, 2023

Conversation

wch
Copy link
Collaborator

@wch wch commented Nov 9, 2023

This PR switches htmltools from setup.cfg/setup.py to the newer pyproject.toml config file.

pyproject.toml Outdated
[tool.setuptools]
packages = ["htmltools"]
include-package-data = true
# test-suite = "tests"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This wasn't commented out in the old setup.cfg, but it caused errors in this file. Should it just be removed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would set any test options using a pytest section

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, pytest seems to work without this line, so I'll just remove it.

@wch wch requested a review from machow November 9, 2023 18:04
Copy link
Collaborator

@machow machow left a comment

Choose a reason for hiding this comment

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

LGTM -- I didn't test out building the package, only read through (and have to admit that I can never remember the names of things in pyproject.toml files)

pyproject.toml Outdated
[tool.setuptools]
packages = ["htmltools"]
include-package-data = true
# test-suite = "tests"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would set any test options using a pytest section

"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you use setuptools-scm, you can set the version automatically using git tags

(but the current approach seems totally fine and reasonable!)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks - maybe in the future we'll switch over.

@wch
Copy link
Collaborator Author

wch commented Nov 9, 2023

One unfortunate thing about this change is that it apparently breaks pyright support when this py-htmltools is installed as an editable package with pip install -e.

microsoft/pyright#3846
microsoft/pyright#6209

It looks like the workaround is to install with editable_mode:

pip install -e . --config-settings editable_mode=strict
# or
pip install -e . --config-settings editable_mode=compat

@wch wch merged commit c0075b4 into main Nov 9, 2023
16 checks passed
@wch wch deleted the pyproject branch November 9, 2023 23:20
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.

2 participants