Skip to content

Commit

Permalink
Handle non-develop branches with dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmogan committed Sep 25, 2024
1 parent 1fb9f56 commit 526e051
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions scripts/spack/make-release-repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re

from dr_tools import parse_yaml_file
from mappings import cmake_to_spack, pyvenv_url_names
from mappings import cmake_to_spack, pyvenv_url_names, packages_without_develop

class MyDumper(yaml.Dumper):

Expand Down Expand Up @@ -296,20 +296,17 @@ def generate_pyvenv_requirements(self, output_file):
for i in self.rdict['pymodules']:
iname = i["name"]
iversion = i["version"]
repo_name = iname
egg_name = iname
if i["source"] == "pypi":
iline = f'{iname}=={iversion}'
if i["source"].startswith("github"):
iuser = i["source"].replace("github_", "")
# Special cases are handled using mappings.py
# Special cases are handled using dictionaries in mappings.py
repo_name = pyvenv_url_names.get(iname, {}).get("repo_name", iname)
egg_name = pyvenv_url_names.get(iname, {}).get("egg_name", repo_name)
# The main branch for moo is called master, not develop
if iname == "moo" and iversion == "develop":
iversion = pyvenv_url_names["moo"]["develop"]
if iname in packages_without_develop:
iversion = packages_without_develop[iname]

if iversion == "develop":
if iversion == "develop" or iversion in packages_without_develop.values():
iline = f"git+https://github.com/{iuser}/{repo_name}@{iversion}#egg={egg_name}"
else:
iline = f"git+https://github.com/{iuser}/{repo_name}@v{iversion}#egg={egg_name}"
Expand Down

0 comments on commit 526e051

Please sign in to comment.