Compare commits
4 commits
origin/0.7
...
stable
Author | SHA1 | Date | |
---|---|---|---|
Sleepy Monax | 433111b555 | ||
Sleepy Monax | a4c5e2376b | ||
Sleepy Monax | 11d0667b83 | ||
Sleepy Monax | 8838340e7d |
4
.github/workflows/checks.yml
vendored
4
.github/workflows/checks.yml
vendored
|
@ -13,12 +13,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
|
7
.github/workflows/publish.yml
vendored
7
.github/workflows/publish.yml
vendored
|
@ -20,11 +20,14 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
|
|
@ -203,8 +203,10 @@ def build(
|
|||
all = False
|
||||
shell.mkdir(target.builddir)
|
||||
ninjaPath = os.path.join(target.builddir, "build.ninja")
|
||||
with open(ninjaPath, "w") as f:
|
||||
gen(f, target, registry)
|
||||
|
||||
if not os.path.exists(ninjaPath):
|
||||
with open(ninjaPath, "w") as f:
|
||||
gen(f, target, registry)
|
||||
|
||||
if components is None:
|
||||
all = True
|
||||
|
@ -228,10 +230,9 @@ def build(
|
|||
)
|
||||
|
||||
outs = list(map(lambda p: str(p.path), products))
|
||||
if all:
|
||||
shell.exec("ninja", "-f", ninjaPath)
|
||||
else:
|
||||
shell.exec("ninja", "-f", ninjaPath, *outs)
|
||||
|
||||
shell.exec("ninja", "-f", ninjaPath, *(outs if not all else []))
|
||||
|
||||
return products
|
||||
|
||||
|
||||
|
@ -243,9 +244,9 @@ def buildCmd(args: cli.Args):
|
|||
registry = model.Registry.use(args)
|
||||
target = model.Target.use(args)
|
||||
componentSpec = args.consumeArg()
|
||||
if componentSpec is None:
|
||||
raise RuntimeError("No component specified")
|
||||
component = registry.lookup(componentSpec, model.Component)
|
||||
component = None
|
||||
if componentSpec is not None:
|
||||
component = registry.lookup(componentSpec, model.Component)
|
||||
build(target, registry, component)[0]
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class Manifest(DataClassJsonMixin):
|
|||
"""
|
||||
Return the directory of the manifest
|
||||
"""
|
||||
return os.path.dirname(self.path)
|
||||
return os.path.relpath(os.path.dirname(self.path), Path.cwd())
|
||||
|
||||
def subpath(self, path) -> Path:
|
||||
return Path(self.dirname()) / path
|
||||
|
@ -121,19 +121,18 @@ class Project(Manifest):
|
|||
|
||||
@staticmethod
|
||||
def ensure() -> "Project":
|
||||
"""
|
||||
Ensure that a project exists in the current directory or any parent directory
|
||||
and chdir to the root of the project.
|
||||
"""
|
||||
project = Project.topmost()
|
||||
if project is None:
|
||||
raise RuntimeError(
|
||||
"No project found in this directory or any parent directory"
|
||||
)
|
||||
os.chdir(project.dirname())
|
||||
return project
|
||||
|
||||
def chdir(self):
|
||||
"""
|
||||
Change the current working directory to the root of the project
|
||||
"""
|
||||
os.chdir(self.dirname())
|
||||
|
||||
@staticmethod
|
||||
def at(path: Path) -> Optional["Project"]:
|
||||
projectManifest = Manifest.tryLoad(path / "project")
|
||||
|
|
|
@ -12,7 +12,7 @@ authors = [
|
|||
{ name = "Cute Engineering", email = "contact@cute.engineering" },
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
requires-python = ">=3.11"
|
||||
license = { text = "MIT" }
|
||||
dynamic = ["version", "dependencies"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue