File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ def __init__(
7777 else :
7878 storage_options = fs .storage_options
7979 self .storage_options = storage_options or {}
80+ assert (
81+ fs is not None
82+ ) # guaranteed by the if/else above; url_to_fs lacks return annotation
8083 self .fs = fs
8184 self .url = path # this is the FS-specific variant
8285 self .specs = AttrDict ()
Original file line number Diff line number Diff line change 1+ import os
2+
13import yaml
24
35from projspec .proj import ProjectSpec
@@ -13,6 +15,22 @@ class CondaProject(ProjectSpec):
1315 # not a spec, but a howto:
1416 spec_doc = "https://conda-incubator.github.io/conda-project/tutorial.html"
1517
18+ @staticmethod
19+ def _create (path : str ) -> None :
20+ name = os .path .basename (path )
21+ env_file = "environment.yml"
22+ with open (f"{ path } /{ env_file } " , "wt" ) as f :
23+ f .write ("channels:\n - conda-forge\n dependencies:\n - python >=3.10\n " )
24+ with open (f"{ path } /conda-project.yml" , "wt" ) as f :
25+ f .write (
26+ f"name: { name } \n "
27+ "environments:\n "
28+ f" default:\n "
29+ f" - { env_file } \n "
30+ "variables: {}\n "
31+ "commands: {}\n "
32+ )
33+
1634 def match (self ) -> bool :
1735 # TODO: a .condarc or environment.yml file is actually enough, e.g.,
1836 # https://github.com/conda-incubator/conda-project/tree/main/examples/condarc-settings
Original file line number Diff line number Diff line change 3030 "pixi" ,
3131 "uv" ,
3232 "briefcase" ,
33+ "conda_project" ,
3334 ],
3435)
3536def test_compliant (tmpdir , cls_name ):
You can’t perform that action at this time.
0 commit comments