Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ running the following command inside it.
pixi run --frozen dev-setup
```
Follow the prompts to configure the set-up to your liking.
Among other configurations, this set-up clones the other Auto-Mech repositories
into the parent directory of your mechdriver repository.
```
ls ..
autochem autofile autoio mechanalyzer mechdriver
```
If you run into issues, see [Appendix C](#appendix-c-manual-developer-setup) for
manual set-up instructions.

Expand All @@ -107,6 +113,22 @@ For more information on activating Pixi environments, see
You can then run any of the examples [in the `examples/` directory](./examples/)
as [described above](#run).

### Git Helper Tasks

The following Pixi tasks are available to facilitate Git operations with your
five local Auto-Mech repositories:

1. `pixi run pull`. This does a `git pull --rebase upstream dev` on all five
repositories to update them against the central Auto-Mech upstream.
2. `pixi run git <commands>`. This runs whatever `git` commands you pass it in
all five repositories.

For example, a common operation you might wish to do is:
```
pixi run pull # Rebase each repo against upstream
pixi run git push origin dev # Push each repo to origin
```

### Test

> [!TIP]
Expand Down Expand Up @@ -178,7 +200,7 @@ override the commit hash check on GitHub Actions and allow your tests to pass.

> [!WARNING]
> Versions are now automatically handled by the BumpVer versioning tool.
> Therefore, do not manually change the version of a given package in its
> Therefore, **do not** manually change the version of a given package in its
> `pyproject.toml`. Instead, the version will be automatically updated by
> triggering the release workflow as described below.

Expand All @@ -195,22 +217,23 @@ This will (1.) bump the version number, (2.) publish the conda package to the
[`auto-mech` channel](https://anaconda.org/Auto-Mech/), and (3.) create an
associated GitHub release.

For now, if you have updated the conda package for a lower-level module such as
`autoio` and want these changes to take effect in MechDriver, you will also need
to update the following two tables in the MechDriver `pyproject.toml`.
If you have done this for one or more of the lower-level repositories, you will
also need to update the MechDriver `pyproject.toml` file with their new version
numbers.
You can do so as follows:
```
[tool.pixi.package.run-dependencies]
...
autoio = "==<new version number>"

[tool.pixi.dependencies]
...
autoio = "==<new version number>"
pixi run pull # Pull the release commits from upstream
pixi run update # Update the version numbers in pyproject.toml
```
These two dependency tables **must match exactly** to ensure that the packaged
version of the code matches the tested version.
This will update the `package.run-dependencies` and `dependencies` tables in
your `pyproject.toml` with the new version numbers of the lower-level
repositories and update the lockfile.
If you make any manual changes to these tables,
**make sure that they match exactly**.
This is necessary to ensure that the packaged version of the code matches the
tested version.

## Subtask Parallelization
## Experimental Feature: Subtask Parallelization

As an experimental feature in MechDriver, you can parallelize across subtasks in
your workflow with
Expand Down
2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ dev-setup-hq = { cmd = "./scripts/dev-setup-hq.sh", cwd = "." }
dev-setup-config = { cmd = "./scripts/dev-setup-config.sh", cwd = "." }
dev-setup = { depends-on = ["dev-setup-repos", "dev-setup-hq", "dev-setup-config"] }
git = { cmd = "./scripts/git.sh", cwd = "." }
update = { cmd = "./scripts/update.sh", cwd = "." }
pull = { cmd = "./scripts/pull.sh", cwd = "." }

[tool.pixi.feature.test.tasks]
test = { cmd = "./scripts/test.py" }
Expand All @@ -145,6 +145,7 @@ dev-test = { cmd = "./scripts/test.py" }
[tool.pixi.feature.build.tasks]
upload = "rattler-build upload anaconda -o Auto-Mech *.conda"
current-version = "bumpver show -n | awk -F': ' '/Current Version: / {print $2}'"
update = { cmd = "./scripts/update.sh", cwd = "." }

[tool.bumpver]
current_version = "0.2025.0"
Expand Down
41 changes: 41 additions & 0 deletions scripts/pull.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

# This script updates each repo against a remote
# (It also updates the amech-dev repo.)
#
# Performs a pull --rebase
#
# Arguments:
# - Remote to update against (default: upstream)
# - Branch to update (default: dev)

set -e # if any command fails, quit
REPOS=("autochem" "autoio" "autofile" "mechanalyzer" "mechdriver")

# 0. Read arguments
REMOTE=${1:-upstream}
BRANCH=${2:-dev}

echo "The following commands will be run in each repository:"
echo " git checkout ${BRANCH}"
echo " git pull --rebase ${REMOTE} ${BRANCH}"
read -p "Is this what you want to do? [y/n] " yn

if [[ $yn =~ ^[Yy]$ ]]; then
# 1. Navigate to mechdriver parent directory
(
cd ..

# 2. Loop through each repo and update
for repo in ${REPOS[@]}
do
printf "\n*** Updating in $(realpath ${repo}) ***\n"
(
cd ${repo} && \
git checkout ${BRANCH} && \
git pull --rebase ${REMOTE} ${BRANCH}
)
printf "******\n"
done
)
fi
38 changes: 11 additions & 27 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,16 @@
# - Branch to update (default: dev)

set -e # if any command fails, quit
REPOS=("autochem" "autoio" "autofile" "mechanalyzer" "mechdriver")
REPOS=("autochem" "autoio" "autofile" "mechanalyzer")

# 0. Read arguments
REMOTE=${1:-upstream}
BRANCH=${2:-dev}
# 1. Loop through each repo and update
for repo in ${REPOS[@]}
do
version=$(pixi run --manifest-path ../$repo current-version)
echo Setting $repo version to $version
sed -i -E "s/($repo *= *\"==)[0-9]+\.[0-9]+\.[0-9]+(\" *)/\1${version}\2/" pyproject.toml
done

echo "The following commands will be run in each repository:"
echo " git checkout ${BRANCH}"
echo " git pull --rebase ${REMOTE} ${BRANCH}"
read -p "Is this what you want to do? [y/n] " yn

if [[ $yn =~ ^[Yy]$ ]]; then
# 1. Navigate to mechdriver parent directory
(
cd ..

# 2. Loop through each repo and update
for repo in ${REPOS[@]}
do
printf "\n*** Updating in $(realpath ${repo}) ***\n"
(
cd ${repo} && \
git checkout ${BRANCH} && \
git pull --rebase ${REMOTE} ${BRANCH}
)
printf "******\n"
done
)
fi
# 2. Update lockfile
echo Updating lockfile
pixi lock
Binary file modified tests/archive.tgz
Binary file not shown.
Loading