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

refactor: use flit as a backend #546

Merged
merged 4 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions MANIFEST.in

This file was deleted.

44 changes: 42 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
[build-system]
requires = ['setuptools >= 40.8.0', 'wheel']
build-backend = 'setuptools.build_meta'
requires = ["flit_core >=3.3"]
build-backend = "flit_core.buildapi"


[project]
name = "packaging"
description = "Core utilities for Python packages"
version = "21.4.dev0"
readme = "README.rst"
requires-python = ">=3.7"
authors = [{name = "Donald Stufft", email = "donald@stufft.io"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []

[project.urls]
Documentation = "https://packaging.pypa.io/"
Source = "https://github.com/pypa/packaging"
henryiii marked this conversation as resolved.
Show resolved Hide resolved


[tool.flit.sdist]
include = ["LICENSE*", "tests/", "docs/"]
exclude = ["docs/_build", "tests/manylinux/build-hello-world.sh", "tests/musllinux/build.sh", "tests/hello-world.c", "tests/__pycache__", "build/__pycache__"]

Choose a reason for hiding this comment

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

This does not include everything that MANIFEST.in has. Also MANIFEST.in is not removed. I think it's not anymore used with flit?

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 think the differences are explained above (unless you see something specific). If I forgot MANIFEST.in, that's a mistake. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

@nanonyme nanonyme Jul 16, 2022

Choose a reason for hiding this comment

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

@henryiii I just tried to test your branch to see if my change to flit helps. I'm confused. Running nox for tests, docs or lint does not create tests/__pycache__ or build/__pycache__ for me. Are you sure these are really relevant to exclude anymore with flit?

Copy link
Member

Choose a reason for hiding this comment

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

... does not create tests/__pycache__

I don't know why that would be unless you are running Python with -B or the equivalent env var.

or build/__pycache__

I think that was added by mistake, we are not bundling a build folder.

Choose a reason for hiding this comment

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

I was not running Python explicitly. I was running this project's test runner and it did not create tests/__pycache__

Choose a reason for hiding this comment

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

I suggest confirming whether build is necessary and removing tests in follow-up when flit is fixed to exclude bytecode automatically and this project depends on newer version of flit.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to exclude __pycache__.

Copy link
Member

Choose a reason for hiding this comment

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

__pycache__ is only automatically excluded from the package folder.

Choose a reason for hiding this comment

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

We might want to report another issue about that... I don't think it makes any sense for sdist to contain Python bytecode.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it makes any sense for sdist to contain Python bytecode.

Correct, Hatchling hard-codes that exclusion.

Choose a reason for hiding this comment

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

Created pypa/flit#568

Copy link

@nanonyme nanonyme Aug 20, 2022

Choose a reason for hiding this comment

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

That said, even if that is fixed, it would imply requiring a very new version of flit. Maybe it makes sense just go with this and have an issue about cleaning it up later.

Copy link
Member

Choose a reason for hiding this comment

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

There hasn't been a flit-core release with recursive globs FYI.



[tool.coverage.run]
Expand All @@ -19,3 +54,8 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
[[tool.mypy.overrides]]
module = ["_manylinux"]
ignore_missing_imports = true


[tool.isort]
profile = "black"
combine_as_imports = true
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

69 changes: 0 additions & 69 deletions setup.py

This file was deleted.