Skip to content

fix: include version file in the distribution#249

Merged
benieric merged 1 commit intoaws:mainfrom
StateFarmIns:include-version-file
Apr 10, 2025
Merged

fix: include version file in the distribution#249
benieric merged 1 commit intoaws:mainfrom
StateFarmIns:include-version-file

Conversation

@jmahlik
Copy link
Copy Markdown
Contributor

@jmahlik jmahlik commented Feb 24, 2025

The version can now be accessed at runtime.

Tested with the following. We can see the version being copied by build. It also shows up in the sdist.

python -m pip install build
python -m build
tar -xzf ./dist/sagemaker_core-1.0.24.tar.gz
ls -l sagemaker_core-1.0.24
total 31
-rw-r--r-- 1 RM13 1049089 11558 Feb 12 16:54 LICENSE
-rw-r--r-- 1 RM13 1049089    15 Feb 12 16:54 MANIFEST.in
-rw-r--r-- 1 RM13 1049089  4945 Feb 24 13:57 PKG-INFO
-rw-r--r-- 1 RM13 1049089  1441 Feb 24 13:54 pyproject.toml
-rw-r--r-- 1 RM13 1049089  3647 Feb 12 16:54 README.rst
-rw-r--r-- 1 RM13 1049089   133 Feb 24 13:57 setup.cfg
drwxr-xr-x 1 RM13 1049089     0 Feb 24 13:57 src/
-rw-r--r-- 1 RM13 1049089     6 Feb 24 13:53 VERSION

Closes #248

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@benieric
Copy link
Copy Markdown
Contributor

benieric commented Apr 4, 2025

Hi thanks for opening this! This is interesting error the VERSION file is included in the MANIFEST.in is it not working somehow?

@benieric
Copy link
Copy Markdown
Contributor

benieric commented Apr 4, 2025

Also, apologies for late review seems the build checks expired, if you could push an empty commit or allow edits by Maintainers would be great!

@jmahlik jmahlik force-pushed the include-version-file branch from 9e3e117 to b517d94 Compare April 7, 2025 17:51
@jmahlik jmahlik requested a review from a team as a code owner April 7, 2025 17:51
@jmahlik jmahlik requested a review from Aditi2424 April 7, 2025 17:51
The __version__ can now be accessed at runtime.

Tested with the following. We can see the version being copied by build.
It also shows up in the sdist.

```bash
python -m pip install build
python -m build
tar -xzf ./dist/sagemaker_core-1.0.24.tar.gz
ls -l sagemaker_core-1.0.24
total 31
-rw-r--r-- 1 RM13 1049089 11558 Feb 12 16:54 LICENSE
-rw-r--r-- 1 RM13 1049089    15 Feb 12 16:54 MANIFEST.in
-rw-r--r-- 1 RM13 1049089  4945 Feb 24 13:57 PKG-INFO
-rw-r--r-- 1 RM13 1049089  1441 Feb 24 13:54 pyproject.toml
-rw-r--r-- 1 RM13 1049089  3647 Feb 12 16:54 README.rst
-rw-r--r-- 1 RM13 1049089   133 Feb 24 13:57 setup.cfg
drwxr-xr-x 1 RM13 1049089     0 Feb 24 13:57 src/
-rw-r--r-- 1 RM13 1049089     6 Feb 24 13:53 VERSION
```

Closes aws#248
@jmahlik jmahlik force-pushed the include-version-file branch from b517d94 to 4ddaaad Compare April 7, 2025 17:53
@jmahlik jmahlik temporarily deployed to manual-approval April 7, 2025 17:53 — with GitHub Actions Inactive
@jmahlik
Copy link
Copy Markdown
Contributor Author

jmahlik commented Apr 7, 2025

Just rebased it, hopefully that will reset them.

This is interesting error the VERSION file is included in the MANIFEST.in is it not working somehow?

It's not included in the sdist. I didn't notice the manifest.in file in the repo. Could be related to the include-package-data not being in the pyproject? In any matter, we could remove the MANIFEST.in since setuptools will automatically add the file when it's in the pyproject. (I always found MANIFEST.in a little unwieldy with it being a separate file to keep track of).

https://setuptools.pypa.io/en/latest/userguide/datafiles.html#include-package-data

@benieric benieric enabled auto-merge (squash) April 10, 2025 19:56
@benieric benieric merged commit a083164 into aws:main Apr 10, 2025
14 checks passed
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.

VERSION file not included in distribution

2 participants