Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeNaccarato committed Mar 12, 2024
1 parent 0cf71ca commit eb8b98e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
github_actions_runner:
# - "macos-12"
- "ubuntu-22.04"
# - "windows-2022"
- "windows-2022"
python_version:
# - "3.8"
# - "3.9"
Expand Down
19 changes: 13 additions & 6 deletions .tools/boilercv_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathlib import Path
from platform import platform
from shlex import split
from shutil import rmtree
from subprocess import run
from sys import executable, version_info

Expand Down Expand Up @@ -66,7 +67,8 @@ def sync():

DEV = Path(".tools/requirements/dev.in")
NODEPS = Path(".tools/requirements/nodeps.in")
LOCKFILE = Path(".lock") / (
PLATFORM_LOCKS = Path(".lock")
PLATFORM_LOCK = PLATFORM_LOCKS / (
"_".join(["requirements", RUNNER, PYTHON_VERSION.replace(".", "")]) + ".txt"
)

Expand Down Expand Up @@ -96,6 +98,7 @@ def lock(highest: bool = False):
)
if lock_result.returncode:
raise RuntimeError(lock_result.stderr)
PLATFORM_LOCKS.mkdir(exist_ok=True, parents=True)
get_lockfile(highest).write_text(
encoding="utf-8",
data="\n".join([
Expand All @@ -110,31 +113,35 @@ def lock(highest: bool = False):

@app.command()
def combine_locks():
PLATFORM_LOCKS.mkdir(exist_ok=True, parents=True)
LOCKS.write_text(
encoding="utf-8",
data=json.dumps(
indent=2,
obj={
lockfile.stem: lockfile.read_text(encoding="utf-8")
for lockfile in LOCKS.iterdir()
for lockfile in PLATFORM_LOCKS.iterdir()
},
)
+ "\n",
)


@app.command()
def get_lock():
LOCKS.parent.mkdir(exist_ok=True, parents=True)
def get_existing_lock():
rmtree(PLATFORM_LOCKS)
PLATFORM_LOCKS.mkdir(exist_ok=True, parents=True)
lockfile = get_lockfile()
lockfile.write_text(
encoding="utf-8", data=json.loads(LOCKS.read_text("utf-8"))[lockfile.stem]
)


def get_lockfile(highest: bool = False):
LOCKFILE.parent.mkdir(exist_ok=True, parents=True)
return LOCKFILE.with_stem(f"{LOCKFILE.stem}_dev" if highest else LOCKFILE.stem)
PLATFORM_LOCK.parent.mkdir(exist_ok=True, parents=True)
return PLATFORM_LOCK.with_stem(
f"{PLATFORM_LOCK.stem}_dev" if highest else PLATFORM_LOCK.stem
)


@dataclass
Expand Down
Loading

0 comments on commit eb8b98e

Please sign in to comment.