Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
swaldhoer committed Mar 29, 2024
2 parents 481eb0f + 75a893d commit 36a9581
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conda/env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def from_file(filename):
yamlstr = yamlb.decode("utf-16")
return from_yaml(yamlstr, filename=filename)
elif filename.endswith("json"):
with open(filename, "r", encoding="utf-8") as fp:
with open(filename, encoding="utf-8") as fp:
envstr = fp.read()
return from_json(envstr, filename=filename)

Expand Down
2 changes: 1 addition & 1 deletion conda/env/specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from ...gateways.connection.session import CONDA_SESSION_SCHEMES
from .binstar import BinstarSpec
from .requirements import RequirementsSpec
from .env_file import EnvironmentFileSpec
from .requirements import RequirementsSpec

FileSpecTypes = Union[Type[EnvironmentFileSpec], Type[RequirementsSpec]]

Expand Down
19 changes: 19 additions & 0 deletions news/12942-create-env-from-json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Add support for `conda env create -f environment.json`. (#12942)

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* Document support for `conda env create -f environment.json`. (#12942)

### Other

* <news item>

0 comments on commit 36a9581

Please sign in to comment.