Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version number consistency check for conda recipe #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
29 changes: 28 additions & 1 deletion .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check version number consistency
shell: python {0}
run: |
"Compare the version numers from the package and the conda recipe."

# collect the package version
import sys
sys.path.append("/home/runner/work/sdrf-pipelines/sdrf-pipelines")
fabianegli marked this conversation as resolved.
Show resolved Hide resolved
import sdrf_pipelines
package_version = sdrf_pipelines.__version__

# collect the version from the conda recipe
with open("./recipe/meta.yaml", encoding="utf-8") as f:
for line in f.readlines():
if line.startswith(" version: "):
recipe_version = line.lstrip(" version:").strip().strip('"')
break
fabianegli marked this conversation as resolved.
Show resolved Hide resolved

if package_version == recipe_version:
print(f"The package and recipe versions are consistent: {package_version}")
else:
raise ValueError(
"ERROR: The versions are inconsistent."
f"\nVersion in ./sdrf_pipelines/__init__.py: {package_version}"
f"\nVersion in ./recipe/meta.yaml: {recipe_version}"
)

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -29,7 +56,7 @@ jobs:

- name: Build the sdrf-pipelines package
run: |
conda build --no-anaconda-upload --package-format .tar.bz2 recipe
conda build --package-format .tar.bz2 recipe

- name: Install the package
run: |
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# recipe/meta.yaml
package:
name: sdrf-pipelines
version: "0.0.30"
version: "0.0.31"

source:
path: ../
Expand Down
Loading