-
Notifications
You must be signed in to change notification settings - Fork 60
Conda package attempt #75
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
Open
ilaflott
wants to merge
49
commits into
main
Choose a base branch
from
conda_package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
833a850
ham-fisted packaging approach- put everything in nested mkmf folder, …
ilaflott 7791ad0
build_conda workflow
ilaflott 523f8e6
move test dir up one level and adjust testing commands, source files …
ilaflott a962698
Merge branch 'main' into conda_package
ilaflott 691fce0
remove git dependency, add verbose run flag to bats testing calls. re…
ilaflott a8bf0c1
update success condition in regex-based check for version-printing te…
ilaflott 8514450
remove PATH env var export from test- shouldnt be needed anymore. cha…
ilaflott 42e73a8
torturing the pipeline and the test to see if i can get more intel. t…
ilaflott 7db3edf
comment out most commands to test build- focus on certain things...
ilaflott d8c1fb2
torture test more. somewhat suspicious of insonsistent comparisons be…
ilaflott 4ad9e29
another attempt... set shell variable to number of lines determined v…
ilaflott c487371
remove failure guard and add a "no-parallelize-within-files" flag... …
ilaflott 0904c22
that option doesnt work for bats. specify only ONE job. add -x for tr…
ilaflott 47f4e8b
what are you doing pipeline????
ilaflott 54007b8
what are you doing pipeline????
ilaflott 13712d6
adjust and torture tests again
ilaflott e4c20ab
adjust and torture tests again because i forgot to change an expected…
ilaflott 76b3b32
lets see what we have won...
ilaflott 9fb952c
ok- throwing a towel in to focus on other things
ilaflott 19aa357
Update README.md
ilaflott 1832388
Update README.md
ilaflott 53ced82
adjust tests back to answers obtained locally
ilaflott e6c03c7
settle on local/conda build answers in t/t001-list_paths.sh
ilaflott 1d66115
remove link file that we will create on-the-fly
ilaflott e0d9ad0
make the link on-the-fly- the local answers should now work in the pi…
ilaflott ff7018f
t003 setup adjustment as well.
ilaflott 1046f0c
add publish workflow
ilaflott 904fba6
adjust setup routines to work for local and conda cases
ilaflott a04500d
adjust (which mkmf) check in bats setup. lets try the git test in the…
ilaflott 53d15ab
clean up commented out shell
ilaflott 25a5cc5
have the setup function in t/t002-git-version-string configure the em…
ilaflott 8dad61a
remove noaa-gfdl channel where not needed. update tag
ilaflott bf0eb7f
replace some_channel in README
ilaflott 616d2cf
forget the Jinja for now
ilaflott c79f958
move the templates back to base of the repo directory, outside of the…
ilaflott 6d7b5e1
Update README.md
ilaflott 93e6c8f
Update publish_conda.yml
ilaflott 45fac6d
restore publish_conda workflow run condition. remove uneeded and old …
ilaflott fb1e646
Merge branch 'main' into conda_package
ilaflott 2afff05
Remove tcsh from requirements in meta.yaml
ilaflott 36116df
Merge branch 'main' into conda_package
ilaflott 57a2df5
Install templates to $PREFIX/share/mkmf/templates; fix t004 template …
ilaflott 8114959
Address underwoo's review feedback on test setup/teardown hygiene
ilaflott 65cdfaa
Remove tcsh from environment.yml; move bats-core to test-only in meta…
ilaflott d23009f
Always prepend correct bin dir to PATH; never skip (underwoo review)
ilaflott 48d0874
test: fail loudly when mkmf is not on PATH instead of silent fallback
ilaflott f328512
ci: add non-conda test workflow
ilaflott 2cee876
ci: merge build_conda and publish_conda into build_and_publish_conda
ilaflott a862043
test: fix t002 hanging on GitHub Actions
ilaflott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: build_and_publish_conda | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0 | ||
| steps: | ||
| - name: Checkout Files | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: 'recursive' | ||
|
|
||
| - name: Run Conda to Build | ||
| env: | ||
| ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
| run: | | ||
| # append the reqd channels | ||
| conda config --append channels conda-forge | ||
| conda config --append channels noaa-gfdl | ||
|
|
||
| # install conda-build and conda-verify | ||
| conda install conda-build conda-verify | ||
|
|
||
| # publish to anaconda.org when pushing to main | ||
| if [ "${{ github.event_name }}" = "push" ] && [ -n "${ANACONDA_TOKEN}" ]; then | ||
| export ANACONDA_API_TOKEN="${ANACONDA_TOKEN}" | ||
| conda config --set anaconda_upload yes | ||
| fi | ||
|
|
||
| # conda build | ||
| conda build . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: test | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update -q | ||
| sudo apt-get install -y -q perl bats | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| export PATH="$(readlink -f mkmf/bin):$PATH" | ||
| bats t/t000-basic.sh | ||
| bats t/t001-list_paths.sh | ||
| bats t/t002-git-version-string.sh | ||
| bats t/t003-mkmf.sh | ||
| bats t/t004-templates.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,103 @@ | ||
| [](https://travis-ci.org/underwoo/mkmf) | ||
|
|
||
| Disclaimer | ||
| ========== | ||
|
|
||
| The United States Department of Commerce (DOC) GitHub project code is | ||
| provided on an "as is" basis and the user assumes responsibility for | ||
| its use. The DOC has relinquished control of the information and no | ||
| longer has responsibility to protect the integrity, confidentiality, | ||
| or availability of the information. Any claims against the Department | ||
| of Commerce stemming from the use of its GitHub project will be | ||
| governed by all applicable Federal law. Any reference to specific | ||
| commercial products, processes, or services by service mark, | ||
| trademark, manufacturer, or otherwise, does not constitute or imply | ||
| their endorsement, recommendation or favoring by the Department of | ||
| Commerce. The Department of Commerce seal and logo, or the seal and | ||
| logo of a DOC bureau, shall not be used in any manner to imply | ||
| endorsement of any commercial product or activity by DOC or the United | ||
| States Government. | ||
|
|
||
| mkmf: Make Makefile | ||
| `mkmf`: Make Makefile | ||
| =================== | ||
|
|
||
| __mkmf__ is a tool written in perl5 that will construct a makefile | ||
| [](https://github.com/NOAA-GFDL/mkmf/actions?query=workflow%3Abuild_conda) | ||
|
|
||
| __`mkmf`__ is a tool written in `perl5` that will construct a makefile | ||
| from distributed source. A single executable program is the typical | ||
| result, but I dare say it is extensible to a makefile for any purpose | ||
| at all. | ||
|
|
||
| __`mkmf`__ is pronounced make-make-file or make-m-f or even McMuff (Paul | ||
| Kushner's suggestion). | ||
|
|
||
| Features | ||
| -------- | ||
|
|
||
| * Understands dependencies in f90 (modules and use), the Fortran | ||
| include statement, and the cpp #include statement in any type of | ||
| source | ||
| * Understands `f90` dependencies (modules and use), Fortran's | ||
| `include` statement, and cpp's `#include` statement, in any type of | ||
| source. | ||
| * No restrictions on filenames, module names, etc. | ||
| * Supports the concept of overlays (where source is maintained in | ||
| layers of directories with a defined precedence) | ||
| * Keeps track of changes to cpp flags, and knows when to recompile | ||
| affected source (i.e, files containing #ifdefs that have been | ||
| changed since the last invocation); | ||
| * Will run on any unix platform that has perl version 5 installed | ||
| layers of directories with a defined precedence). | ||
| * Keeps track of changes to `cpp` flags, and knows when to recompile | ||
| affected source (i.e, files containing `#ifdefs` that have been | ||
| changed since the last invocation). | ||
| * It is free, and released under GPL. | ||
|
|
||
|
|
||
| Pronunciation | ||
| ------------- | ||
| Requirements | ||
| ------------ | ||
| `mkmf` and `list_paths` can be run on any unix type system that has | ||
| C-shell ([`tcsh`](http://www.tcsh.org/)) and `perl` version 5 installed. | ||
| `git-version-string` requires `git`. | ||
|
|
||
| __mkmf__ is pronounced make-make-file or make-m-f or even McMuff (Paul | ||
| Kushner's suggestion). | ||
| Usage as a `conda` package requires `conda`. | ||
|
|
||
| For testing, we recommend [`bats-core`](https://github.com/bats-core/bats-core), | ||
ilaflott marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| a current and up-to-date (as of January 2025) fork of the original | ||
ilaflott marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [`bats`](https://github.com/sstephenson/bats). Tests are run in the `build_conda` | ||
| github workflow automatically for PRs. To test locally by hand, simply call `bats` | ||
| and target the testing scripts in `t/` as desired from the root of this repository. | ||
|
|
||
| Installation | ||
| ------------ | ||
|
|
||
| *mkmf* and *list_paths* can be run on any \*nix type system that has | ||
| C-shell ([tcsh](http://www.tcsh.org/)) and Perl version 5 installed. | ||
| ### **(no `conda`)** install and use a copy of this repository | ||
| Clone the repository onto a file system with the aforementioned requirements. | ||
| Then and add the `mkmf/bin` directory to your shell's `$PATH`, like so: | ||
| ``` | ||
| git clone https://github.com/noaa-gfdl/mkmf.git mkmf && cd mkmf | ||
| export $PATH=$PWD/mkmf/bin:$PATH | ||
| ``` | ||
|
|
||
| ### `conda env create` and use a copy of this repository | ||
| Similar to the previous approach, clone, but before adjusting `$PATH`, | ||
| we create the `conda` environment named `mkmf` with all the required | ||
| dependencies. To change the default name of the environment, edit the | ||
| first line in `environment.yaml`. | ||
| ``` | ||
| git clone https://github.com/noaa-gfdl/mkmf.git mkmf && cd mkmf | ||
| conda env create -y -f ./environment.yaml | ||
| conda activate mkmf | ||
| export $PATH=$PWD/mkmf/bin:$PATH | ||
ilaflott marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ### install package from the `conda` channel into `conda` environment | ||
| Dissimilar from the aforementioned approaches, this requires no cloning, | ||
| nor any manual adjusting of `$PATH`. It just assumes your `conda` env of | ||
| choice is already activated. The package is retrieved from the `noaa-gfdl` | ||
| conda channel. | ||
|
|
||
| The following line installs `mkmf` iinto the current environment, and | ||
| handles everything: | ||
| ``` | ||
| conda activate existing_env | ||
| (existing_env) conda install noaa-gfdl::mkmf | ||
| ``` | ||
|
|
||
| ### create a conda environment using the package from the channel | ||
| This approach creates a fresh, new environment with `mkmf` and all of | ||
| it's dependencies, and requires no manual adjusting of `$PATH` | ||
| ``` | ||
| conda create -y -n env_name noaa-gfdl::mkmf | ||
| ``` | ||
|
|
||
|
|
||
| To install, place the repository on the file system and add the bin | ||
| directory to PATH. | ||
| Disclaimer | ||
| ========== | ||
|
|
||
| The United States Department of Commerce (DOC) GitHub project code is | ||
| provided on an "as is" basis and the user assumes responsibility for | ||
| its use. The DOC has relinquished control of the information and no | ||
| longer has responsibility to protect the integrity, confidentiality, | ||
| or availability of the information. Any claims against the Department | ||
| of Commerce stemming from the use of its GitHub project will be | ||
| governed by all applicable Federal law. Any reference to specific | ||
| commercial products, processes, or services by service mark, | ||
| trademark, manufacturer, or otherwise, does not constitute or imply | ||
| their endorsement, recommendation or favoring by the Department of | ||
| Commerce. The Department of Commerce seal and logo, or the seal and | ||
| logo of a DOC bureau, shall not be used in any manner to imply | ||
| endorsement of any commercial product or activity by DOC or the United | ||
| States Government. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| name: mkmf | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - conda-forge::perl | ||
| - conda-forge::bats-core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package: | ||
| name: mkmf | ||
| version: '2025.01' | ||
| # version: '{{ environ.get("GIT_DESCRIBE_TAG", data.get("version")) }}' | ||
|
|
||
| source: | ||
| path: . | ||
|
|
||
| build: | ||
| script: | ||
| - cp mkmf/bin/mkmf $PREFIX/bin | ||
| - cp mkmf/bin/list_paths $PREFIX/bin | ||
| - cp mkmf/bin/git-version-string $PREFIX/bin | ||
| # Install templates to the standard data-files location so downstream | ||
| # tools (e.g. fre-cli) can reference them via a stable, predictable path. | ||
| # Users can point mkmf at a specific template with: | ||
| # mkmf -t $CONDA_PREFIX/share/mkmf/templates/<name>.mk | ||
| - mkdir -p $PREFIX/share/mkmf/templates | ||
| - cp -r templates/* $PREFIX/share/mkmf/templates/ | ||
|
|
||
|
|
||
| requirements: | ||
| host: | ||
| - conda-forge::perl | ||
| run: | ||
| - conda-forge::perl | ||
|
|
||
| test: | ||
| requires: | ||
| - conda-forge::perl | ||
| - conda-forge::bats-core | ||
| source_files: | ||
| - t/ | ||
| - mkmf/ | ||
| commands: | ||
| - which mkmf | ||
| - bats -j 1 -x --verbose-run t/t000-basic.sh | ||
| - bats -j 1 -x --verbose-run t/t001-list_paths.sh | ||
| - bats -j 1 -x --verbose-run t/t002-git-version-string.sh | ||
| - bats -j 1 -x --verbose-run t/t003-mkmf.sh | ||
| - bats -j 1 -x --verbose-run t/t004-templates.sh | ||
|
|
||
|
|
||
|
|
||
| about: | ||
| home: https://github.com/NOAA-GFDL/mkmf |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.