-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add Python function to get Fortran Version #41
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #41 +/- ##
==========================================
+ Coverage 52.53% 52.56% +0.02%
==========================================
Files 5 6 +1
Lines 1616 1621 +5
==========================================
+ Hits 849 852 +3
- Misses 767 769 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
I tried to use preprocessor directives to compile the If someone knows how to do something like:
We could track a |
I'm not going to be much help here. It is ready for review as is? |
This implementation is ready for review, but I think we should have a meeting with a larger group to discuss this feature and potential implementations before anything gets merged. |
I pushed a git-tracked implementation of |
Dont think this is robust enough solution. This solution works alright for cloning the repo. However, this will not work for users who download the released version of the code, as there is no git history. The version string will then be whatever error message is given. I would, instead of the git version, use the version found in However, using this approach you need to run the code (import the lib at minimum) to get the version. How about using a more traditional workflow for shared libraries. Once the |
|
Purpose
The goal of this PR is to provide an example for how to insert the git version/commit hash into the compiled fortran object at build time. Then it is included in the python wrapper, so that a python script can check what version the compiled part of the code is.
This functionality is primarily for repostate. It would allow repostate to ensure that the compiled fortran version of the code is the same as the python version of the code. Before a run, repostate would check for a common function name:
fortranVersion
in the top level of a python module. If it exists, it will ensure that the version matches the version it found for the python package.Expected time until merged
A week or two to discuss where to place this function to ensure that it can work with more difficult repos such as adflow that never import the fortran module unless the
ADFLOW
object is instantiated.Type of change
Testing
I have tried it and it works, not sure how to implement tests
Checklist
flake8
andblack
to make sure the code adheres to PEP-8 and is consistently formatted