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

fix(packaging): Correctly build package for versioning #12

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

devsjc
Copy link
Contributor

@devsjc devsjc commented Feb 10, 2025

Closes #11

Actually gets the version number correctly by specifying the project name as it occurs in pyproject.toml to pull the version, as opposed to the name of the package. Also pins torch according to the environment, and includes the version in the built vresion tag.

@devsjc devsjc requested a review from peterdudfield February 10, 2025 11:48
@@ -25,7 +25,7 @@

# Get package version
try:
__version__ = version("cloudcasting_app")
__version__ = version("cloudcasting-app")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the crux of what was wrong before!

WORKDIR /opt/app
COPY src /opt/app/src
COPY pyproject.toml /opt/app
COPY .git /opt/app/.git
Copy link
Contributor

Choose a reason for hiding this comment

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

I can never remember if you change WORKDIR do you then copy COPY src /src. I can never remember

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested the build and run locally so whatever I've done here has worked! I think you can do that if you don't use absolute paths, i.e.

WORKDIR /app
COPY src src

is equivalent to

WORKDIR /app
COPY src /app/src

I think? Either way, the above seems to work!

Copy link
Contributor

@peterdudfield peterdudfield left a comment

Choose a reason for hiding this comment

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

See comment, but looks good

"torch>=2.3; sys_platform != 'darwin' or platform_machine != 'x86_64'",
"typer==0.15.1",
"xarray==2025.1.2",
"zarr==2.18.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for pinning

@devsjc devsjc merged commit 68d5554 into main Feb 10, 2025
2 checks passed
@devsjc devsjc deleted the devsjc/fix-versioning branch February 10, 2025 11:54
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.

Improve CI to bump version
2 participants