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

Change default_python template to auto-update version on each wheel build #1034

Merged
merged 5 commits into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ from setuptools import setup, find_packages
import sys
sys.path.append('./src')

import datetime
import {{.project_name}}

setup(
name="{{.project_name}}",
version={{.project_name}}.__version__,
# We use timestamp as Local version identifier (https://peps.python.org/pep-0440/#local-version-identifiers.)
# to ensure that changes to wheel package are picked up when used on all-purpose clusters
version={{.project_name}}.__version__ + "+" + datetime.datetime.utcnow().strftime("%Y%m%d.%H%M%S"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the build tag also trigger pip upgrades?

Also, is this compatible with https://peps.python.org/pep-0440/#implicit-post-release-number ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pietern yeah, it's in PEP and called "Local version identifier" https://peps.python.org/pep-0440/#local-version-identifiers.
I did the manual tests and pip correctly upgrades such versions

Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent, thanks for confirming! Could you add this link to the setup.py with a brief explanation why we do this?

url="https://databricks.com",
author="{{user_name}}",
description="wheel file based on {{.project_name}}/src",
Expand Down