ariebovenberg / whenever

⏰ Modern datetime library for Python
https://whenever.rtfd.io
MIT License
893 stars 15 forks source link

Installation seems to put two *.rst files in “public” area #23

Closed kseistrup closed 9 months ago

kseistrup commented 9 months ago

Disclaimer: I am probably just an incompetent python module packager.

After building a wheel, I find CHANGELOG.rst and README.rst outside whenever's directory:

$ uname -or
6.7.1-arch1-1 GNU/Linux
$ python --version
Python 3.11.6
$ git clone https://github.com/ariebovenberg/whenever.git
$ cd whenever
$ python -m build --wheel --no-isolation
$ unzip -l dist/*.whl  # or: bsdtar tvf dist/*.whl 
Archive:  dist/whenever-0.3.0-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
     1768  1980-01-01 00:00   CHANGELOG.rst
     9892  1980-01-01 00:00   README.rst
    77672  1980-01-01 00:00   whenever/__init__.py
        0  1980-01-01 00:00   whenever/py.typed
     1088  1980-01-01 00:00   whenever-0.3.0.dist-info/LICENSE
    10765  1980-01-01 00:00   whenever-0.3.0.dist-info/METADATA
       88  1980-01-01 00:00   whenever-0.3.0.dist-info/WHEEL
      585  2016-01-01 00:00   whenever-0.3.0.dist-info/RECORD
---------                     -------
   101858                     8 files

The same thing happens when I install whenever from PyPI in a virtual environment:

$ (whenever) pip install whenever
$ (whenever) cd …/site-packages/
$ (whenever) ls -l
drwxr-xr-x     - kas kas  1 Feb 15:32 __pycache__
drwxr-xr-x     - kas kas  1 Feb 15:32 _distutils_hack
.rw-r--r--    18 kas kas  1 Feb 15:32 _virtualenv.pth
.rw-r--r-- 4.329 kas kas  1 Feb 15:32 _virtualenv.py
.rw-r--r-- 1.768 kas kas  1 Feb 15:33 CHANGELOG.rst
.rw-r-----   151 kas kas  1 Feb 15:32 distutils-precedence.pth
drwxr-xr-x     - kas kas  1 Feb 15:32 pip
drwxr-xr-x     - kas kas  1 Feb 15:32 pip-23.3.2.dist-info
.rw-r-----     0 kas kas  1 Feb 15:32 pip-23.3.2.virtualenv
drwxr-xr-x     - kas kas  1 Feb 15:32 pkg_resources
.rw-r--r-- 9.892 kas kas  1 Feb 15:33 README.rst
drwxr-xr-x     - kas kas  1 Feb 15:32 setuptools
drwxr-xr-x     - kas kas  1 Feb 15:32 setuptools-69.0.3.dist-info
.rw-r-----     0 kas kas  1 Feb 15:32 setuptools-69.0.3.virtualenv
drwxr-xr-x     - kas kas  1 Feb 15:32 wheel
drwxr-xr-x     - kas kas  1 Feb 15:32 wheel-0.42.0.dist-info
.rw-r-----     0 kas kas  1 Feb 15:32 wheel-0.42.0.virtualenv
drwxr-xr-x     - kas kas  1 Feb 15:33 whenever
drwxr-xr-x     - kas kas  1 Feb 15:33 whenever-0.3.0.dist-info

It is consistent with pyproject.toml, that reads:

   ⋮
include = ["CHANGELOG.rst", "README.rst"]
   ⋮

but if every python package/wheel did that, they would [potentially] end up overwriting eachother's files.

Am I doing something wrong?


Context:

I am planning to package this for ArchLinux User Repository (AUR), and for now I am just moving the offending files to the package's individual doc directory, but that is not usually necessary.

ariebovenberg commented 9 months ago

This looks like a mistake on my side. I'll investigate. Alternatively: if you can submit a PR and all tests pass (I'll do some additional checks), we can fix this asap.

kseistrup commented 9 months ago

if you can submit a PR

I'm sorry, but I have no idea how python module packaging works.

kseistrup commented 9 months ago

PS: If I comment out the offending include line in pyproject.toml, the resultant wheel looks like expected. However, whether I comment it out or leave it as it was, a make check fails with:

Found 18 errors in 6 files (checked 9 source files) make: *** [Makefile:7: mypy] Error 1


edit: typo

ariebovenberg commented 9 months ago

A fixed version should be rolled out soon. Thanks @kseistrup for opening this issue!

ariebovenberg commented 9 months ago

@kseistrup can you confirm this is fixed on version 0.3.1?

kseistrup commented 9 months ago

Looks good, @ariebovenberg! :cartwheeling: