File tree Expand file tree Collapse file tree 6 files changed +27
-5
lines changed
Expand file tree Collapse file tree 6 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ projspec = "projspec.__main__:main"
3939po_test = [" pytest" ]
4040
4141[tool .poetry ]
42- # poetry can't resolve hatch's dynamic version but needs a value
42+ # poetry can't resolve hatch's dynamic versioning but needs a value.
4343version =" 0.0.1"
4444
4545[tool .hatch .version ]
Original file line number Diff line number Diff line change 77
88import projspec .proj
99
10- # TODO: allow subcommands to list known types and set config
10+ # TODO: allow subcommands to execute artifacts, list known types and set config
1111
1212
1313@click .command ()
Original file line number Diff line number Diff line change 11from .base import Project , ProjectSpec
22from .conda_package import CondaRecipe , RattlerRecipe
33from .conda_project import CondaProject
4+ from .documentation import RTD , MDBook
45from .git import GitRepo
56from .pixi import Pixi
67from .poetry import PoetryProject
78from .pyscript import PyScriptSpec
89from .python_code import PythonCode , PythonLibrary
10+ from .rust import Rust , RustPython
911from .uv import UVProject
1012
1113__all__ = [
1416 "CondaRecipe" ,
1517 "CondaProject" ,
1618 "GitRepo" ,
19+ "MDBook" ,
1720 "PoetryProject" ,
1821 "RattlerRecipe" ,
1922 "Pixi" ,
2023 "PyScriptSpec" ,
2124 "PythonCode" ,
2225 "PythonLibrary" ,
26+ "RTD" ,
27+ "Rust" ,
28+ "RustPython" ,
2329 "UVProject" ,
2430]
Original file line number Diff line number Diff line change 1+ import re
2+
13from projspec .proj import ProjectSpec
24
35
@@ -18,5 +20,10 @@ class RTD(ProjectSpec):
1820
1921 def match (self ) -> bool :
2022 basenames = [_ .rsplit ("/" , 1 )[- 1 ] for _ in self .root .filelist ]
23+ return any (re .match ("[.]?readthedocs.y[a]?ml" , _ ) for _ in basenames )
24+
25+ def parse (self ) -> None :
2126 # supports mkdocs and sphinx builders
22- return ".readthedocs.yaml" in basenames
27+ # build env usually in `python.install[*].requirements`, which can
28+ # point to a requirements.txt or conda.environment for conda env.
29+ pass
Original file line number Diff line number Diff line change @@ -132,8 +132,7 @@ def __contains__(self, item):
132132
133133
134134def _yaml_no_jinja (fileobj ):
135- # TODO: rather than skip jinja stuff, we can copy conda code to parse it, but
136- # templates can involve function calls and reference to env vars we don't have
135+ """Read YAML text from the given file, attempting to evaluate jinja2 templates."""
137136 txt = fileobj .read ().decode ()
138137 lines = []
139138 variables = {}
@@ -194,3 +193,13 @@ def flatten(x: Iterable):
194193 except TypeError :
195194 out .add (item )
196195 return out
196+
197+
198+ def sort_version_strings (versions : Iterable [str ]) -> list [str ]:
199+ def int_or (x ):
200+ try :
201+ return int (x )
202+ except ValueError :
203+ return x
204+
205+ return sorted (versions , key = lambda s : [int_or (_ ) for _ in s .split ("." )])
You can’t perform that action at this time.
0 commit comments