Skip to content

CheckGitDescribeCompatibility.cmake is PEP 440 compliant.#3384

Merged
nrnhines merged 5 commits into
masterfrom
hines/pep440
Apr 25, 2025
Merged

CheckGitDescribeCompatibility.cmake is PEP 440 compliant.#3384
nrnhines merged 5 commits into
masterfrom
hines/pep440

Conversation

@nrnhines

Copy link
Copy Markdown
Member

At the moment this does not have much of a substantive use since wheel names are chosen by setup.py call to setuptoosls_scm. However it does validate and normalize user chosen tags and git describe versions. E.g.

$ git describe
9.0a-1381-g18b87a10a

$ cmake ...
-- PEP 440 compliant version: 9.0.0.a0.post1381

The normalized version is in ${PROJECT_VERSION}

@azure-pipelines

Copy link
Copy Markdown

✔️ 18b87a1 -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ aa13b42 -> Azure artifacts URL

@codecov

codecov Bot commented Apr 16, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.34%. Comparing base (8a07765) to head (b7c9964).
Report is 79 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3384   +/-   ##
=======================================
  Coverage   68.34%   68.34%           
=======================================
  Files         682      682           
  Lines      116452   116452           
=======================================
  Hits        79584    79584           
  Misses      36868    36868           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JCGoran JCGoran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see there are some regexes being used, I assume they capture whatever the spec says (see https://packaging.python.org/en/latest/specifications/version-specifiers/#appendix-parsing-version-strings-with-regular-expressions). Moreover, if this will get rid of that annoying "fatal: git describe" message, I'm all for it.

@nrnhines

nrnhines commented Apr 17, 2025

Copy link
Copy Markdown
Member Author

I see there are some regexes being used, I assume they capture whatever the spec says

I need to add the equivalent cmake function for is_canonical and do some more testing.

@nrnhines nrnhines marked this pull request as draft April 19, 2025 10:25
@nrnhines

Copy link
Copy Markdown
Member Author

For a long time, the previous tag of the master has been 9.0a and now git describe is 9.0a-1381-g04a50e981. Before this PR and even now, wheel names seem to be chosen by setup.py call to setuptools_scm. Looking at neuron-nightly at pypi.org this is normalized to 9.0a1.dev1381 .

8987974 attempts to handle a tag containing dev with the regex group (a|b|rc|dev)? with dev being an exception that appends the dev portion to the end. Ie.

-- From '9.0a-1384-g898797455', PEP 440 compliant version: 9.0.0a0.post1384
git tag -a 9.0.1dev 18b87a1 -m "test"
-- From '9.0.1dev-3-g898797455', PEP 440 compliant version: 9.0.1.post3.dev0
git tag -d 9.0.1dev
git tag -a 9.0.1dev -m test
-- From '9.0.1dev', PEP 440 compliant version: 9.0.1.dev0

Presently for this PR, CheckGitDescribeCompatibility.cmake does not raise a FATAL_ERROR.

git tag -a 9.0.1.dev -m test
cmake ..
CMake Warning at cmake/CheckGitDescribeCompatibility.cmake:83 (message):
  Version '9.0.1.dev' does not match expected format
  X.Y(.Z)?(a|b|rc|dev)?(N)?(-N-gHASH)?.  Note '?' mean 0 or 1 of preceding
  group.

CMake Warning at cmake/CheckGitDescribeCompatibility.cmake:186 (message):
  Unable to validate git describe output.
Call Stack (most recent call first):
  CMakeLists.txt:241 (include)

-- PROJECT_VERSION 9.0.0

Allowing the common .dev or .a and removing the '.' for the normalization would be easy. And 'dev' with no number could be a special case so that instead of normalizing 9.0.1dev-3-g898797455 to 9.0.1.post3.dev0, it could be normalized to 9.0.1.dev3

@sonarqubecloud

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

✔️ b7c9964 -> Azure artifacts URL

@nrnhines nrnhines marked this pull request as ready for review April 25, 2025 17:03
@nrnhines nrnhines merged commit fd51182 into master Apr 25, 2025
@nrnhines nrnhines deleted the hines/pep440 branch April 25, 2025 17:10
nrnhines added a commit that referenced this pull request May 20, 2025
* wheel build generally uses numpy >= 2 for python >= 3.9

* for wheel and mac pgk distributions, rx3d cython compiled with -O1

* adopt PYTHONPATH feature from master _binwrapper.py

* correct nmodl signatures for _getelm and getarg. (windows gcc-15)

* Yet a few more nmodl function signatures.

* Turn off hoc_association test.

* Use platform appropriate separator for PYTHONPATH.

* At least Apple arm64 needs last argtype of ctypes._CFuncPtr (#2046)


Co-authored-by: Olli Lupton <oliver.lupton@epfl.ch>

* CheckGitDescribeCompatibility.cmake is PEP 440 compliant. (#3384)

* version macros test computes (major, minor, pat) from pep440 version

* An rxd/species.py string should be raw.

* See #3407 work around a problem sphinx has with itself.

* PEP440 regex too complicated for cmake 3.22.1 . Use Python

* Some ModelDB uses M_PI, struct timezone, and u_int32_t

* update changelog

---------

Co-authored-by: Olli Lupton <oliver.lupton@epfl.ch>
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