Skip to content

pep420 namespace package, add pyproject.toml, bump version #3

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Conversation

ThomasWaldmann
Copy link
Contributor

No description provided.

Copy link

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

Thx

@roland-ruedenauer
Copy link

I suggest also adding the bootstrap scss files below data/. They are required when compiling custom Sass code to CSS.

@ThomasWaldmann
Copy link
Contributor Author

@roland-ruedenauer for first "modernized" release, I wanted to avoid ANY changes except modernizing it.

What do you think about xstatic-py/xstatic#15 (comment) ?

@roland-ruedenauer
Copy link

If technically not required, I would have probably not added a dependency an the base xstatic package. As you thankfully updated the existing xstatic-* package releases on PyPI, I currently see no problem with having installed "mixed" xstatic-* packages.

Q: Does it make a difference using .rst for the Readme file in a python project? In the xstatic base package you did change the file format.

@ThomasWaldmann
Copy link
Contributor Author

ThomasWaldmann commented Apr 30, 2025

@roland-ruedenauer I added it so we can update/release all resource packages before xstatic-2.0.0 gets released. Due to the dependency, people will then still all use the old packages.

Yeah, with wheels, it seems less problematic. But we can do it nevertheless, just to avoid unforeseen issues.

Guess rst renders a bit more pretty. Didn't feel like reformatting all the stuff though.

@ThomasWaldmann ThomasWaldmann changed the title pep420 namespace package, add pyproject.toml pep420 namespace package, add pyproject.toml, bump version Apr 30, 2025
@roland-ruedenauer
Copy link

I locally tested packaging xstatic-bootrap once again. Please note, that when using find_namespace_packages you get rid off this warning from setuptools occurring for each data subfolder:

/tmp/build-env-b5o6uh45/lib/python3.12/site-packages/setuptools/command/build_py.py:212: _Warning: Package 'xstatic.pkg.bootstrap.data.css' is absent from the `packages` configuration.
!!

        ********************************************************************************
        ############################
        # Package would be ignored #
        ############################
        Python recognizes 'xstatic.pkg.bootstrap.data.css' as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that 'xstatic.pkg.bootstrap.data.css' is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want 'xstatic.pkg.bootstrap.data.css' to be distributed and are
        already explicitly excluding 'xstatic.pkg.bootstrap.data.css' via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************

!!

@ThomasWaldmann
Copy link
Contributor Author

ThomasWaldmann commented May 1, 2025

@roland-ruedenauer Thanks for trying it out and the hint.

I updated this PR (bootstrap) and font-awesome with using find_namespace_packages() to avoid the warning. All other PRs are still todo.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants