conda-forge / hdf4-feedstock

A conda-smithy repository for hdf4.
BSD 3-Clause "New" or "Revised" License
1 stars 17 forks source link

Use PREFIX in tests rather than an environment name #14

Closed lbdreyer closed 7 years ago

lbdreyer commented 7 years ago

When I try to build this recipe locally (with conda_build_all), the test: conda inspect linkages -n _test hdf4 is failing as it can't seem to find the _test environment.

When I use -p ${PREFIX} rather than -n _test, it does work.

conda-forge-linter commented 7 years ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

lbdreyer commented 7 years ago

The builds are still going to fail as it is using conda build version 1.21.14 which includes the prefix_length problem:

Traceback (most recent call last):
  File "/Users/travis/miniconda3/bin/conda-inspect", line 5, in <module>
    sys.exit(main())
  File "/Users/travis/miniconda3/lib/python3.5/site-packages/conda_build/main_inspect.py", line 172, in main
    default=config.prefix_length,
AttributeError: 'Config' object has no attribute 'prefix_length'

This problem has now been resolved in conda build 2.0 but the conda build version this is using was pinned to version 1.x in the conda-forge-build-setup-feedstock PR #27

ocefpaf commented 7 years ago

@lbdreyer that is because conda-build-all is not ready for conda-build 2.0. If you don't need this to pass right now we can wait for the next version of conda-build-all. Otherwise we could pin to conda-build=1.21.11 and use the old conda-inspect syntax.

lbdreyer commented 7 years ago

@ocefpaf I am happy to wait until the next version of conda-build-all. It is a very minor change that I can patch locally.

pelson commented 7 years ago

@ocefpaf - just curious why ${CONDA_DEFAULT_ENV} is safer than ${PREFIX}? I have struggled to find much docs on the former, but PREFIX is pretty ubiquitous (e.g. http://conda.pydata.org/docs/building/environment-vars.html?highlight=prefix). I suspect neither are ever going anywhere (having just read a github conda issue thread about CONDA_DEFAULT_ENV). It is quite a common thing to need to know about PREFIX, yet I wasn't aware of CONDA_DEFAULT_ENV at all...

I'm happy to go either way on this, but it makes sense to pick one option across conda-forge that has the lowest cognitive burden.

Sorry to bother you @msarahan, but just wondering if you have any input on this?

msarahan commented 7 years ago

@pelson

You'd use the first for just build or test tasks. You'd use the latter two (probably the last one) if you wanted to, say, set an environment variable to point to the installed prefix (or some subpath) at activation time.

ocefpaf commented 7 years ago

Now we know :-)

PS: do not recall why I though CONDA_PREFIX was better.

On Oct 3, 2016 9:06 AM, "Mike Sarahan" notifications@github.com wrote:

@pelson https://github.com/pelson

  • PREFIX: defined by conda-build. Only available at build time or test time. Is either build prefix, or test prefix (whichever phase you're in at the time of script execution.)
  • _CONDA_DEFAULTENV: defined by conda at environment activation time. Is either name of active environment (if activated by name) or path to environment (otherwise). Probably only truly useful for display of environment. Not dependable as path.
  • _CONDAPREFIX: same as CONDA_DEFAULT_ENV, but is always full path to environment. Relatively recent addition to conda (sometime during 4.1.x, I believe.)

You'd use the first for just build or test tasks. You'd use the latter two (probably the last one) if you wanted to, say, set an environment variable to point to the installed prefix (or some subpath) at activation time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/conda-forge/hdf4-feedstock/pull/14#issuecomment-251089965, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6BL_7KCOAQRhyD3nZnrCm98HMH19Kjks5qwO_agaJpZM4J3AQh .