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

Include automatically data files at build time #24

Closed

Conversation

MattBlack85
Copy link

Hi!

First of all, feel free to discard this if there is another way that should not belong in upstream to do so.

While checking the packaged package for ArchLinux I noticed the data files are not there, to build the package the python -m build --wheel --no-isolation --skip-dependency-check command is used and this doesn't bring data files along, which leads to exception at runtime.

This change will include all files under astropy_iers_data/data/ in the build output

@pllim pllim requested a review from astrofrog March 29, 2024 20:53
@pllim
Copy link
Member

pllim commented Apr 29, 2024

@astrofrog , can you please review? Thanks!

@astrofrog
Copy link
Member

@MattBlack85 I wonder if this might be due to setuptools_scm being missing at build time since you are skipping the build isolation. Can you make sure setuptools_scm is installed and try again? (without the changes in this PR)

@MattBlack85
Copy link
Author

hey @astrofrog setuptools-acm it is already installed as a build dependency, see

makedepends=(python-build python-installer python-wheel python-setuptools-scm)

@astrofrog
Copy link
Member

@MattBlack85 - and just to check, are you running the build inside the git repo or is this a non-git checkout? (e.g. tar/zip file)

@MattBlack85
Copy link
Author

hey @astrofrog the build script pulls a tar gzipped copy of the repo from github tags

@astrofrog
Copy link
Member

@MattBlack85 - could you check if you still have the issue if you use the tar gzipped file from PyPI? (just to help me diagnose this)

@MattBlack85
Copy link
Author

@astrofrog indeed it seems to copy the data files from pypi, any idea what could be the difference?

@astrofrog
Copy link
Member

@MattBlack85 - yes, I think it is because we use setuptools_scm to manage the data files, and it ensures the metadata is correct in a tar release for PyPI. When you git clone the repo it also works fine because setuptools_scm uses git to determine important data files. However, the tarfile generated by GitHub is not a proper release tar file, and so is incomplete.

@MattBlack85
Copy link
Author

@astrofrog pypi links are a bit weird tho and impossible to build deterministically as the content prefixing the package name change from release to release

the way is done in PKGBUILD files is the following https://gitlab.archlinux.org/archlinux/packaging/packages/python-astropy-iers-data/-/blob/main/PKGBUILD?ref_type=heads#L13 where one goes in, updates the version and everything else is automated.

Can we include this change into upstream or should we mantain a patch to pull in data files from git?

@astrofrog
Copy link
Member

@astrofrog
Copy link
Member

Here's an example of a deterministic link:

https://pypi.io/packages/source/a/astropy/astropy-6.1.0.tar.gz

I'll go ahead and close this, but feel free to re-open if the above link format doesn't work for you.

@astrofrog astrofrog closed this Sep 5, 2024
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.

3 participants