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(jsii-pacmak): fully support the Python Version Identification part of PEP440 #4462

Merged
merged 6 commits into from
Mar 25, 2024

Conversation

icj217
Copy link
Contributor

@icj217 icj217 commented Mar 18, 2024

jsii-pacmak's current version logic does not fully implement/adhere to PEP440 in two respects:

  • There is no support for "local version identifiers", which are basically the same as SemVer's build metadata (e.g. 1.2.3+foobar), when used in conjunction with a pre-release label.
  • The current pre-release logic doesn't reflect the ability for python pre-releases to include post-release and developmental release labels in conjunction with the pre-release itself (e.g. 1.2.3.rc1.post2.dev3)

This PR addresses these gaps so that the python release supports these features. I've kept support for the pre label as a synonym for dev,

E.g. now 1.2.3-rc.1.dev.2.post.3+foobar will now yield 1.2.3.rc1.post3.dev2+foobar for python packages.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@icj217 icj217 changed the title fix(jsii-pacmak): Pass on semver build metadata as local version identifiers fix(jsii-pacmak): Pass on semver build metadata as python local version identifiers Mar 18, 2024
…t PEP440 pre, post, and developmental releases
@icj217 icj217 changed the title fix(jsii-pacmak): Pass on semver build metadata as python local version identifiers fix(jsii-pacmak): Improve python release version calculation logic Mar 18, 2024
@icj217 icj217 changed the title fix(jsii-pacmak): Improve python release version calculation logic fix(jsii-pacmak): Improve python release version conversion logic Mar 18, 2024
Copy link
Contributor

mergify bot commented Mar 25, 2024

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Mar 25, 2024
@mrgrain mrgrain changed the title fix(jsii-pacmak): Improve python release version conversion logic fix(jsii-pacmak): fully support the Python Version Identification part of PEP440 Mar 25, 2024
Copy link
Contributor

mergify bot commented Mar 25, 2024

Merging (with squash)...

Copy link
Contributor

mergify bot commented Mar 25, 2024

Merging (with squash)...

@mergify mergify bot merged commit c8483fb into aws:main Mar 25, 2024
28 checks passed
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Mar 25, 2024
mergify bot pushed a commit to projen/projen that referenced this pull request Mar 25, 2024
…rt of PEP440 (#3474)

The semver util's current version logic does not fully implement/adhere to PEP440 in two respects:
* There is no support for "[local version identifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#local-version-identifiers)", which are basically the same as SemVer's build metadata (e.g. `1.2.3+foobar`), when used in conjunction with a pre-release label.
* The current pre-release logic doesn't reflect the ability for python pre-releases to include [post-release](https://packaging.python.org/en/latest/specifications/version-specifiers/#post-releases) and [developmental release](https://packaging.python.org/en/latest/specifications/version-specifiers/#developmental-releases) labels in conjunction with the pre-release itself (e.g. `1.2.3.rc1.post2.dev3`)

This PR addresses these gaps so that the python release supports these features. I've kept support for the `pre` label as a synonym for `dev`.

Projen and JSII's logic diverged ever so slightly re: including a `.` between the version and pre-release labels (e.g. projen was yielding `1.2.3rc0` while JSII would yield `1.2.3.rc0`. I decided to update projen's logic to mirror that from JSII.

E.g. now `1.2.3-rc.1.dev.2.post.3+foobar` will now yield `1.2.3.rc1.post3.dev2+foobar` for python packages.

I have an identical PR open over in jsii: aws/jsii#4462

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@icj217
Copy link
Contributor Author

icj217 commented Apr 4, 2024

@mrgrain Any idea when this will be released? Not sure if there's an established cadence/process that I'm unaware of.

@mrgrain
Copy link
Contributor

mrgrain commented Apr 4, 2024

Sorry, this fell through the cracks. We'll do one next week.

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.

2 participants