File tree Expand file tree Collapse file tree 5 files changed +29
-6
lines changed
Expand file tree Collapse file tree 5 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 22
33
44class License (BaseContent ):
5+ # https://opensource.org/licenses
6+ # (fields may change)
7+
8+ # although a repo may well have a freestanding LICENSE file, many project metadata
9+ # formats also specify this by name or URL.
510 shortname : str
611 fullname : str
712 url : str
Original file line number Diff line number Diff line change 1+ # ruff, isort, mypy ...
Original file line number Diff line number Diff line change 33
44
55class CondaProject (ProjectSpec ):
6+ # not a spec, but a howto:
67 spec_doc = "https://conda-incubator.github.io/conda-project/tutorial.html"
78
89 def match (self ) -> bool :
910 basenames = {_ .rsplit ("/" , 1 )[- 1 ] for _ in self .root .filelist }
10- return basenames .isdisjoint ({"conda-project.yml" , "conda-meta.yaml" })
11+ return not basenames .isdisjoint (
12+ {"conda-project.yml" , "conda-meta.yaml" }
13+ )
1114
1215 def parse (self ) -> None :
13- # just stash for now
1416 # TODO: a .condarc or environment.yml file is actually enough, e.g.,
15- # https://github.com/conda-incubator/conda-project/tree/main/examples/condarc-settings
16- # but we could argue that such are not really _useful_ projects
17- with self .root .fs .open (f"{ self .root .url } /conda-project.yml" ) as f :
18- self .meta = _yaml_no_jinja (f )
17+ # https://github.com/conda-incubator/conda-project/tree/main/examples/condarc-settings
18+ # but we could argue that such are not really _useful_ projects; but can you
19+ # ever see a .condarc otherwise?
20+
21+ try :
22+ with self .root .fs .open (f"{ self .root .url } /conda-project.yml" ) as f :
23+ _yaml_no_jinja (f )
24+ except FileNotFoundError :
25+ with self .root .fs .open (f"{ self .root .url } /conda-project.yaml" ) as f :
26+ _yaml_no_jinja (f )
Original file line number Diff line number Diff line change 1+ # https://helm.sh/docs/topics/charts/#the-chartyaml-file
Original file line number Diff line number Diff line change 1+ from projspec .proj import ProjectSpec
2+
3+
4+ class PoetryProject (ProjectSpec ):
5+ spec_doc = "https://python-poetry.org/docs/pyproject/"
6+
7+ def match (self ) -> bool :
8+ return "poetry" in self .root .metadata .get ("tool" )
You can’t perform that action at this time.
0 commit comments