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

newer conda-lock drops optional attribute #129

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Conversation

AlbertDeFusco
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #129 (066d580) into main (dbf457b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   97.69%   97.69%           
=======================================
  Files           9        9           
  Lines         826      826           
=======================================
  Hits          807      807           
  Misses         19       19           
Impacted Files Coverage Δ
src/conda_project/project.py 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@mattkram mattkram left a comment

Choose a reason for hiding this comment

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

LGTM. Any chance of a string (p.category) coming back with whitespace or is that well-controlled?

@AlbertDeFusco
Copy link
Contributor Author

Good question. I'll have to check

@AlbertDeFusco
Copy link
Contributor Author

conda-lock will throw an error during render

pydantic.error_wrappers.ValidationError: 1 validation error for Lockfile
package -> 0 -> category
  none is not an allowed value (type=type_error.none.not_allowed)

@mattkram
Copy link
Contributor

conda-lock will throw an error during render

pydantic.error_wrappers.ValidationError: 1 validation error for Lockfile
package -> 0 -> category
  none is not an allowed value (type=type_error.none.not_allowed)

Okay so my guess is they've got an enum of some sort? I should look.

As long as we're confident that non-optional packages are marked as "main" I say let's merge it.

@AlbertDeFusco
Copy link
Contributor Author

There is an edge case in conda-lock itself that would be brought up to conda-project. If you provide a category that is not called main.

dependencies:
  - python=3.10
channels: [defaults]
category: not-main

The env will lock but conda-lock install does not find packages in the main category and does not install anything

❯ conda-lock lock
Locking dependencies for ['osx-arm64']...
INFO:conda_lock.conda_solver:osx-arm64 using specs ['python 3.10.*']
 - Install lock using: conda-lock install --name YOURENV conda-lock.yml

❯ conda-lock install -p ./env
INFO:root:Preparing transaction: ...working... done
INFO:root:Verifying transaction: ...working... done
INFO:root:Executing transaction: ...working... done

❯ conda list -p ./env
# packages in environment at ./env:
#
# Name                    Version                   Build  Channel

I think in a separate issue maybe we can address some warnings if no main category is found.

@AlbertDeFusco AlbertDeFusco merged commit 4cd8001 into main Jul 24, 2023
82 checks passed
@AlbertDeFusco AlbertDeFusco deleted the fix/conda-lock-update branch July 24, 2023 15:22
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