Skip to content

Commit

Permalink
fix: use micromamba action
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherStranger committed Aug 9, 2024
1 parent cb1d9ab commit 1edab6b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,31 @@ on:
jobs:
release:
name: Release
runs-on: mambaorg/micromamba:1.5.8
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 1.5.8-0
environment-file: base_env.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: all
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: lts/*
- name: Setup mamba
- name: Setup poetry
run: |
micromamba install -y -n base -f base_env.yml && micromamba clean --all --yes
eval "$(micromamba shell hook --shell bash)"
micromamba activate base
poetry config virtualenvs.create false
poetry install
poetry build
- name: Release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
Expand Down
20 changes: 5 additions & 15 deletions experiment_runner/processing/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ def load_config(self, config_path: Path = CONFIG_PATH):
):
self._config = self.create_config()
else:
print(
"Aborting! Configuration path was defined but no configuration found!"
)
print("Aborting! Configuration path was defined but no configuration found!")
sys.exit(-1)
else:
loaded_config: Any = OmegaConf.to_container(OmegaConf.load(config_path))
Expand All @@ -113,9 +111,7 @@ def load_config(self, config_path: Path = CONFIG_PATH):
raise ValueError("Loaded config is not valid!")

if self.config.use_mailer and not self.config.password:
self.config.password = Prompt.ask(
":closed_lock_with_key: Password", password=True
)
self.config.password = Prompt.ask(":closed_lock_with_key: Password", password=True)

if not self.config.password:
print("No Password provided. Exiting...")
Expand All @@ -128,17 +124,13 @@ def create_config(self) -> ConfigurationFile:
if self.config_path.exists() and not Confirm.ask(
":warning: The config does already exist. Recreate it? :warning:"
):
loaded_config: Any = OmegaConf.to_container(
OmegaConf.load(self.config_path)
)
loaded_config: Any = OmegaConf.to_container(OmegaConf.load(self.config_path))
if isinstance(loaded_config, Dict):
return ConfigurationFile(**loaded_config)
raise ValueError("Loaded config is not valid!")

self._config: ConfigurationFile = OmegaConf.structured(ConfigurationFile)
print(
"This config fully supports Omegaconf syntax. See: https://omegaconf.readthedocs.io/"
)
print("This config fully supports Omegaconf syntax. See: https://omegaconf.readthedocs.io/")
print("--------- Mailer Configuration ------------")

if Confirm.ask("Do you want to configure an email-address for the mailer?"):
Expand All @@ -162,9 +154,7 @@ def create_config(self) -> ConfigurationFile:
if show_config:
print(Syntax(OmegaConf.to_yaml(self.config).strip(), "yaml"))

should_save = Confirm.ask(
"Save config? Otherwise it will be used for this run only.", default=True
)
should_save = Confirm.ask("Save config? Otherwise it will be used for this run only.", default=True)

if should_save:
self.save_config()
Expand Down

0 comments on commit 1edab6b

Please sign in to comment.