Skip to content

Commit

Permalink
New version for src workchain (#300)
Browse files Browse the repository at this point in the history
Fix the issue that `QeAppWorkChain` is not updated with the QeApp.

We are now maintaining `setup.py` of the `QeAppWorkChain` in the `src/__init__.py` separated from the QeApp PyPI package. Every time the QeApp is released, it is supposed to bump the QE workchain version so it can be updated with the installation. The bug is the version of the workchain is hardcoded to `v1.0` and updating the qeApp will not update the workchain in the end. 
It is fixed by having the workchain version synchronize with the qeApp version. It uses the `bumpver` tool to accomplish this.
  • Loading branch information
unkcpz committed Nov 1, 2022
1 parent 5d98a81 commit 60fa5e7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ classifiers =
project_urls =
Bug Tracker = https://github.com/aiidalab/aiidalab-qe/issues
Documentation = https://github.com/aiidalab/aiidalab-qe#readme
Logo = https://raw.githubusercontent.com/aiidalab/aiidalab-qe/v20.12.0/miscellaneous/logos/QE.jpg
Logo = https://raw.githubusercontent.com/aiidalab/aiidalab-qe/master/miscellaneous/logos/QE.jpg

[options]
packages = find:
install_requires =
Jinja2~=2.11.3
aiida-core~=1.0
aiida-quantumespresso~=3.5
aiidalab-qe-workchain@https://github.com/aiidalab/aiidalab-qe/releases/download/v22.09.1/aiidalab_qe_workchain-1.0-py3-none-any.whl
aiidalab-qe-workchain@https://github.com/aiidalab/aiidalab-qe/releases/download/v22.09.1/aiidalab_qe_workchain-22.9.1-py3-none-any.whl
aiidalab-widgets-base~=1.4.1
filelock~=3.3.0
importlib-resources~=5.2.2
Expand All @@ -34,7 +34,7 @@ python_requires = >=3.7

[options.extras_require]
dev =
bumpver==2021.1114
bumpver==2022.1119
pre-commit==2.11.1

[options.package_data]
Expand Down Expand Up @@ -63,7 +63,9 @@ push = True
[bumpver:file_patterns]
aiidalab_qe/version.py =
__version__ = "{version}"
src/aiidalab_qe_workchain/__init__.py =
__version__ = "{pep440_version}"
setup.cfg =
current_version = "{version}"
version = {pep440_version}
aiidalab-qe-workchain@https://github.com/aiidalab/aiidalab-qe/releases/download/{version}/aiidalab_qe_workchain-1.0-py3-none-any.whl
aiidalab-qe-workchain@https://github.com/aiidalab/aiidalab-qe/releases/download/{version}/aiidalab_qe_workchain-{pep440_version}-py3-none-any.whl
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `src/` directory contains the `aiidalab_qe_workchain` package that must be i

The app distributes its own AiiDA workchain implementation which constitutes an app dependency and must therefore be globally installed so that the AiiDA daemon is able to import it.
The workchain package is automatically built as a wheel and attached to every app release via the [GitHub actions `Release` workflow](https://github.com/aiidalab/aiidalab-qe/blob/master/.github/workflows/release.yml).
In this way one can install the wheel directly from the GitHub release via a PEP 508 compliant URL, example: `aiidalab-qe-workchain @ https://github.com/aiidalab/aiidalab-qe/releases/download/v22.01.0/aiidalab_qe_workchain-1.0-py3-none-any.whl`
In this way one can install the wheel directly from the GitHub release via a PEP 508 compliant URL, example: `aiidalab-qe-workchain @ https://github.com/aiidalab/aiidalab-qe/releases/download/v22.01.0/aiidalab_qe_workchain-22.01.0-py3-none-any.whl`

## How to update the `aiidalab_qe_workchain` package

Expand All @@ -26,7 +26,7 @@ Additional notes:

The following alternatives approaches for the distribution of the workchain wheel could be considered (in rough order of preference at the time of writing):

1. Install the package directly from the app directory (something like: `aiidalab-qe-workchain@file://./src/dist/aiidalab_qe_workchain-1.0-py3-none-any.whl`).
1. Install the package directly from the app directory (something like: `aiidalab-qe-workchain@file://./src/dist/aiidalab_qe_workchain-22.01.0-py3-none-any.whl`).
However this is currently not possible, because it would be difficult to reliably determine the absolute location of the package and non-local URIs are not universally supported
2. Distribute the wheel [via GitHub packages](https://github.com/orgs/aiidalab/packages) once [Python packages are supported](https://github.com/github/roadmap/issues/94).
3. Distribute the workchain as part of its own dedicated package or as part of the [aiida-quantumespresso](https://github.com/aiidateam/aiida-quantumespresso) package.
Expand Down
2 changes: 1 addition & 1 deletion src/aiidalab_qe_workchain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,4 @@ def on_terminated(self):
)


__version__ = "1.0"
__version__ = "22.9.1"
2 changes: 1 addition & 1 deletion src/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = aiidalab_qe_workchain
version = 1.0
version = 22.09.1
description = Package for the AiiDAlab QE app workchain
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 60fa5e7

Please sign in to comment.