Skip to content

Commit fbb0f86

Browse files
committed
bits
1 parent ad3ac54 commit fbb0f86

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

src/projspec/content/license.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33

44
class 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

src/projspec/content/linter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ruff, isort, mypy ...

src/projspec/proj/conda_project.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@
33

44

55
class 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)

src/projspec/proj/helm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://helm.sh/docs/topics/charts/#the-chartyaml-file

src/projspec/proj/poetry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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")

0 commit comments

Comments
 (0)