Skip to content

Commit aa102b2

Browse files
Merge pull request #66 from RoboStack/rattler-build-humble
Migrate to rattler-build and add fixes from early 2025 rebuild of ros-noetic, ros-humble and ros-jazzy
2 parents 0e6ff6d + 1b61041 commit aa102b2

19 files changed

+413
-300
lines changed

.drone.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 19.10b0
3+
rev: 24.3.0
44
hooks:
55
- id: black
66
args: [--safe, --quiet]
77
- repo: https://github.com/asottile/blacken-docs
8-
rev: v1.7.0
8+
rev: 1.16.0
99
hooks:
1010
- id: blacken-docs
11-
additional_dependencies: [black==19.10b0]
11+
additional_dependencies: [black]
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v3.2.0
13+
rev: v4.6.0
1414
hooks:
1515
- id: trailing-whitespace
1616
exclude: ^examples/
@@ -21,14 +21,14 @@ repos:
2121
# hooks:
2222
# - id: isort
2323
# exclude: tests/data
24-
- repo: https://gitlab.com/pycqa/flake8
25-
rev: 3.8.3
26-
hooks:
27-
- id: flake8
28-
exclude: tests/data
29-
language_version: python3
30-
additional_dependencies:
31-
- flake8-typing-imports==1.9.0
32-
- flake8-builtins==1.5.3
33-
- flake8-bugbear==20.1.4
34-
# - flake8-isort==3.0.1
24+
# - repo: https://github.com/PyCQA/flake8
25+
# rev: 7.0.0
26+
# hooks:
27+
# - id: flake8
28+
# exclude: tests/data
29+
# language_version: python3
30+
# additional_dependencies:
31+
# - flake8-typing-imports==1.9.0
32+
# - flake8-builtins==1.5.3
33+
# - flake8-bugbear==20.1.4
34+
# # - flake8-isort==3.0.1

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ console_scripts =
4242
vinca-gha = vinca.generate_gha:main
4343
vinca-azure = vinca.generate_azure:main
4444
vinca-migrate = vinca.migrate:main
45+
vinca-snapshot = vinca.snapshot:main
4546

4647
[flake8]
4748
import-order-style = google

vinca/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.3"
1+
__version__ = "0.0.4"

vinca/azure_templates/linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export CI=azure
22
export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME
33
export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME})
4-
.scripts/run_docker_build.sh
4+
.scripts/build_linux.sh
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
set "CI=azure"
2-
call activate base
1+
set "CI=true"
32

43
:: 4 cores available on GHA: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
54
:: CPU_COUNT is passed through conda build: https://github.com/conda/conda-build/pull/1149
65
set CPU_COUNT=4
76

87
set PYTHONUNBUFFERED=1
98

10-
conda config --set show_channel_urls true
11-
conda config --set auto_update_conda false
12-
conda config --set add_pip_as_python_dependency false
13-
149
call setup_x64
1510

1611
:: Set the conda-build working directory to a smaller path
@@ -28,14 +23,3 @@ if defined CI (
2823

2924
:: Make paths like C:\\hostedtoolcache\\windows\\Ruby\\2.5.7\\x64\\bin garbage
3025
set "PATH=%PATH:ostedtoolcache=%"
31-
32-
mkdir "%CONDA%\\etc\\conda\\activate.d"
33-
34-
echo set "CONDA_BLD_PATH=%CONDA_BLD_PATH%" > "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
35-
echo set "CPU_COUNT=%CPU_COUNT%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
36-
echo set "PYTHONUNBUFFERED=%PYTHONUNBUFFERED%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
37-
echo set "PATH=%PATH%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
38-
39-
conda info
40-
conda config --show-sources
41-
conda list --show-channel-urls

vinca/distro.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77

88
class Distro(object):
9-
def __init__(self, distro_name, python_version=None):
9+
def __init__(self, distro_name, python_version=None, snapshot=None):
1010
index = get_index(get_index_url())
1111
self._distro = get_cached_distribution(index, distro_name)
1212
self.distro_name = distro_name
13+
self.snapshot = snapshot
1314
# set up ROS environments
1415
if python_version is None:
1516
python_version = index.distributions[distro_name]["python_version"]
@@ -60,20 +61,29 @@ def get_depends(self, pkg, ignore_pkgs=None):
6061
return dependencies
6162

6263
def get_released_repo(self, pkg_name):
64+
if self.snapshot and pkg_name in self.snapshot:
65+
return (
66+
self.snapshot[pkg_name].get("url", None),
67+
self.snapshot[pkg_name].get("tag", None),
68+
)
69+
6370
pkg = self._distro.release_packages[pkg_name]
6471
repo = self._distro.repositories[pkg.repository_name].release_repository
6572
release_tag = get_release_tag(repo, pkg_name)
6673
return repo.url, release_tag
6774

6875
def check_package(self, pkg_name):
6976
if pkg_name in self._distro.release_packages:
70-
return True
77+
return self.snapshot is None or pkg_name in self.snapshot
7178
elif pkg_name in self.build_packages:
7279
return True
7380
else:
7481
return False
7582

7683
def get_version(self, pkg_name):
84+
if self.snapshot and pkg_name in self.snapshot:
85+
return self.snapshot[pkg_name].get("version", None)
86+
7787
pkg = self._distro.release_packages[pkg_name]
7888
repo = self._distro.repositories[pkg.repository_name].release_repository
7989
return repo.version.split("-")[0]
@@ -86,3 +96,6 @@ def check_ros1(self):
8696

8797
def get_python_version(self):
8898
return self._python_version
99+
100+
def get_package_names(self):
101+
return self._distro.release_packages.keys()

vinca/generate_azure.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ def main():
526526

527527
if args.platform == "osx-64":
528528
build_osx_pipeline(
529-
stages, args.trigger_branch, script=azure_osx_script,
529+
stages,
530+
args.trigger_branch,
531+
script=azure_osx_script,
530532
)
531533

532534
if args.platform == "osx-arm64":

vinca/generate_gha.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def parse_command_line(argv):
6767
action="store_true",
6868
help="search for additional_recipes folder?",
6969
)
70-
70+
7171
parser.add_argument(
7272
"-b",
7373
"--batch_size",
@@ -198,7 +198,9 @@ def add_additional_recipes(args):
198198
print("Checking if ", name, version, bnumber, " exists")
199199
skip = False
200200
for repo in repodatas:
201-
for _, pkg in repo.get("packages", {}).items():
201+
repo_pkgs = repo.get("packages", {})
202+
repo_pkgs.update(repo.get("packages.conda", {}))
203+
for _, pkg in repo_pkgs.items():
202204
if (
203205
pkg["name"] == name
204206
and pkg["version"] == version
@@ -263,8 +265,6 @@ def build_linux_pipeline(
263265
if docker_image is None:
264266
docker_image = "condaforge/linux-anvil-cos7-x86_64"
265267

266-
jobs = []
267-
job_names = []
268268
prev_batch_keys = []
269269

270270
for i, s in enumerate(stages):
@@ -319,8 +319,6 @@ def build_osx_pipeline(
319319
if azure_template is None:
320320
azure_template = blurb
321321

322-
jobs = []
323-
job_names = []
324322
prev_batch_keys = []
325323
for i, s in enumerate(stages):
326324
stage_name = f"stage_{i}"
@@ -394,21 +392,13 @@ def build_win_pipeline(stages, trigger_branch, outfile="win.yml", azure_template
394392
"steps": [
395393
{"name": "Checkout code", "uses": "actions/checkout@v4"},
396394
{
397-
"uses": "conda-incubator/setup-miniconda@v3",
395+
"name": "Setup pixi",
396+
"uses": "prefix-dev/[email protected]",
398397
"with": {
399-
"channels": "conda-forge",
400-
"miniforge-variant": "Mambaforge",
401-
"miniforge-version": "latest",
402-
"use-mamba": "true",
403-
"channel-priority": "true",
404-
"python-version": "3.11",
405-
"activate-environment": "test",
398+
"pixi-version": "v0.39.4",
399+
"cache": "true",
406400
},
407401
},
408-
{
409-
"run": "mamba install -c conda-forge -n base --yes --quiet conda-build pip mamba ruamel.yaml anaconda-client boa",
410-
"name": "Install conda-build, boa and activate environment",
411-
},
412402
{
413403
"uses": "egor-tensin/cleanup-path@v4",
414404
"with": {
@@ -571,7 +561,9 @@ def main():
571561

572562
if args.platform == "osx-64":
573563
build_osx_pipeline(
574-
stages, args.trigger_branch, script=azure_osx_script,
564+
stages,
565+
args.trigger_branch,
566+
script=azure_osx_script,
575567
)
576568

577569
if args.platform == "osx-arm64":

0 commit comments

Comments
 (0)