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

Prevent LICENSE, README.rst, and HISTORY.rst from being installed in site-packages #135

Merged
merged 1 commit into from
May 30, 2021

Conversation

J-M0
Copy link
Contributor

@J-M0 J-M0 commented May 27, 2021

Putting LICENSE, README.rst, and HISTORY.rst in the include section of pyproject.toml will cause those files to be included in the final wheel and result in them ending up in site-packages when yaspin is installed.

$ ls ~/Library/Python/3.9/lib/python/site-packages/
HISTORY.rst                 pkg_resources
LICENSE                     setuptools
README.rst                  setuptools-57.0.0.dist-info
__pycache__                 termcolor-1.1.0.dist-info
_distutils_hack             termcolor.py
distutils-precedence.pth    yaspin
pip                         yaspin-2.0.0.dist-info
pip-21.1.2.dist-info
$ cat ~/Library/Python/3.9/lib/python/site-packages/README.rst
|Logo|

=====================================================================
``yaspin``: **Y**\ et **A**\ nother Terminal **Spin**\ ner for Python
=====================================================================

|Build Status| |Coverage| |Codacy| |pyup| |black-fmt|

|pypi| |Versions| |Wheel| |Examples|

|DownloadsTot| |DownloadsW|


``Yaspin`` provides a full-featured terminal spinner to show the progress during long-hanging operations.
<snip>

Poetry automatically includes LICENSE and README.rst in the sdist and wheel so they do not need to be specified. Also poetry will automatically pick up all files in a package so yaspin/data/spinners.json does not need to be specified either.

HISTORY.rst does need to be explicitly included, but should only be in the sdist.

See python-poetry/poetry#2015 (comment) for details

…site-packages

Also let poetry find packages automatically rather than specify them explicitly
@codecov-commenter
Copy link

Codecov Report

Merging #135 (fd5f4b6) into master (f219c15) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   96.18%   96.18%           
=======================================
  Files           7        7           
  Lines         341      341           
=======================================
  Hits          328      328           
  Misses         13       13           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f219c15...fd5f4b6. Read the comment docs.

Copy link
Owner

@pavdmyt pavdmyt left a comment

Choose a reason for hiding this comment

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

@J-M0 Thanks for PR!

Will include this into the next yaspin release.

@pavdmyt pavdmyt merged commit 3f990cc into pavdmyt:master May 30, 2021
@pavdmyt
Copy link
Owner

pavdmyt commented Aug 14, 2021

Published in v2.1.0

@cmungall
Copy link

cmungall commented May 20, 2022

Hello, I arrived here when searching how to fix an analogous problem we are having with our poetry releases.

Did this solution work for you? We are trying something analogous with our repo and the magic sdist doesn't seem to work

I notice when I download the wheel for yaspin the files aren't included at all, so maybe this didn't work as expected?

tar -ztf ~/Downloads/yaspin-2.1.0-py3-none-any.whl
yaspin/init.py
yaspin/api.py
yaspin/base_spinner.py
yaspin/constants.py
yaspin/core.py
yaspin/data/spinners.json
yaspin/helpers.py
yaspin/signal_handlers.py
yaspin/spinners.py
yaspin-2.1.0.dist-info/LICENSE
yaspin-2.1.0.dist-info/WHEEL
yaspin-2.1.0.dist-info/METADATA
yaspin-2.1.0.dist-info/RECORD

The source distribution has your additional files at the top level:

tar -ztf ~/Downloads/yaspin-2.1.0.tar.gz
yaspin-2.1.0/HISTORY.rst
yaspin-2.1.0/LICENSE
yaspin-2.1.0/README.rst
yaspin-2.1.0/examples/advanced_colors.py
yaspin-2.1.0/examples/basic_usage.py
yaspin-2.1.0/examples/cli_spinners.py
yaspin-2.1.0/examples/colors.py
yaspin-2.1.0/examples/demo.py
yaspin-2.1.0/examples/dynamic_text.py
yaspin-2.1.0/examples/finalizers.py
yaspin-2.1.0/examples/hide_show.py
yaspin-2.1.0/examples/hide_show_prompt_toolkit.py
yaspin-2.1.0/examples/reverse_spinner.py
yaspin-2.1.0/examples/right_spinner.py
yaspin-2.1.0/examples/signals.py
yaspin-2.1.0/examples/spinner_properties.py
yaspin-2.1.0/examples/timer_spinner.py
yaspin-2.1.0/examples/write_method.py
yaspin-2.1.0/pyproject.toml
yaspin-2.1.0/tests/init.py
yaspin-2.1.0/tests/conftest.py
yaspin-2.1.0/tests/test_attrs.py
yaspin-2.1.0/tests/test_finalizers.py
yaspin-2.1.0/tests/test_in_out.py
yaspin-2.1.0/tests/test_pipes.py
yaspin-2.1.0/tests/test_properties.py
yaspin-2.1.0/tests/test_signals.py
yaspin-2.1.0/tests/test_spinners.py
yaspin-2.1.0/tests/test_timer.py
yaspin-2.1.0/tests/test_yaspin.py
yaspin-2.1.0/yaspin/init.py
yaspin-2.1.0/yaspin/api.py
yaspin-2.1.0/yaspin/base_spinner.py
yaspin-2.1.0/yaspin/constants.py
yaspin-2.1.0/yaspin/core.py
yaspin-2.1.0/yaspin/data/spinners.json
yaspin-2.1.0/yaspin/helpers.py
yaspin-2.1.0/yaspin/signal_handlers.py
yaspin-2.1.0/yaspin/spinners.py
yaspin-2.1.0/setup.py
yaspin-2.1.0/PKG-INFO

@pavdmyt
Copy link
Owner

pavdmyt commented May 25, 2022

Hello @cmungall

The idea was to remove those files from site-packages directory, when yaspin is installed. However, they are still inside the wheel, under dist-info.

@J-M0 J-M0 deleted the wheel-fix branch January 5, 2024 15:05
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

4 participants