Skip to content

Commit c8d304d

Browse files
Merge branch 'main' into bump-rapidfuzz_3.13.0_to_3.14.0_for_main
2 parents 0aeef38 + 900d79a commit c8d304d

File tree

306 files changed

+6376
-1972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+6376
-1972
lines changed

.github/copilot-instructions.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Emscripten-forge Recipes
2+
3+
Emscripten-forge is a conda package repository for building packages targeting the `emscripten-wasm32` platform (WebAssembly). The repository contains package recipes and uses `pixi` for environment management and `rattler-build` for package building.
4+
5+
6+
## Add New Recipes
7+
8+
To add new recipes follow these steps:
9+
10+
* check if the recipe needs building or is a noarch recipes. **Do not add noarch recipes**
11+
* check if the recipe is already present in the repository
12+
* if the recipe already exists, update the recipe as needed
13+
* else, create a new directory for the recipe under `recipes/recipes_emscripten/`
14+
* add a `recipe.yaml` file with the necessary metadata and build instructions
15+
* include any additional files (e.g., patches, scripts) as needed
16+
* test the recipe using the appropriate testing framework
17+
* the title of the PR that adds a new recipe should be "Add [package-name]"
18+
19+
### Recipe source section
20+
21+
For Python packages, the `url` must follow this format
22+
```yaml
23+
source:
24+
- url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name|replace('-','_') }}-${{ version }}.tar.gz
25+
```
26+
27+
### Recipe build section
28+
29+
For Python packages, include the following
30+
```yaml
31+
build:
32+
number: 0
33+
script: ${{ PYTHON }} -m pip install . ${{ PIP_ARGS }}
34+
```
35+
36+
For R packages, include
37+
```yaml
38+
build:
39+
number: 0
40+
script: $R CMD INSTALL $R_ARGS .
41+
```
42+
43+
For all other packages, add a `build.sh` script with build instructions
44+
45+
46+
### Recipe test section
47+
48+
For Python packages, create a `test_import_[package].py` file. This test
49+
file should contain at least one import test in the following form
50+
```python
51+
def test_import_[recipe]():
52+
import [package]
53+
```
54+
55+
And in the recipe.yaml, add the following:
56+
```yaml
57+
tests:
58+
- script: pytester
59+
files:
60+
recipe:
61+
- test_import_[package].py
62+
```
63+
64+
For other packages, add tests to check the package contents in the recipe.yaml
65+
For example:
66+
```yaml
67+
tests:
68+
- package_contents:
69+
files:
70+
- include/package.hpp
71+
- lib/package.a
72+
- lib/package.so
73+
```
74+
75+
### Recipe extra section
76+
77+
The extra section in recipe.yaml should be this
78+
```yaml
79+
extra:
80+
recipe-maintainers:
81+
- Copilot
82+
```
83+
84+
Do not add other recipe maintainers.
85+
86+
## Check if the recipe is working
87+
88+
To build the recipe you worked on with rattler-build with:
89+
(where YOUR_RECIPE_NAME is the name of the directory you created):
90+
91+
92+
rattler-build build \
93+
--package-format tar-bz2 \
94+
-c https://repo.prefix.dev/emscripten-forge-dev \
95+
-c microsoft \
96+
-c conda-forge \
97+
--target-platform emscripten-wasm32 \
98+
--skip-existing none \
99+
-m variant.yaml \
100+
--recipe recipes/recipes_emscripten/YOUR_RECIPE_NAME
101+
102+
103+
* this will build the recipe and run tests
104+
* check the output for any errors or warnings and try to resolve them
105+
* if you fail to run these commands, report so

.github/workflows/.condarc

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

.github/workflows/build_docs.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: docs
1+
name: Docs
22

33
on:
44
workflow_dispatch:
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
paths:
1010
- 'docs/**'
11+
1112
jobs:
1213

1314
build_docs:
@@ -23,24 +24,27 @@ jobs:
2324
# SETUP
2425
################################################################
2526
- name: Checkout repo
26-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2728
with:
2829
fetch-depth: 0
2930

3031
################################################################
3132
# CONFIG
3233
################################################################
33-
- uses: prefix-dev/setup-pixi@v0.6.0
34-
with:
35-
pixi-version: v0.20.1
36-
- run: |
37-
pixi run docs-build -d docs_build
34+
- name: Setup pixi
35+
uses: prefix-dev/setup-pixi@v0.9.0
36+
37+
################################################################
38+
# BUILD
39+
################################################################
40+
- name: Build docs
41+
run: pixi run docs-build -d docs_build
3842

3943
################################################################
40-
# upload to github pages
44+
# UPLOAD
4145
################################################################
4246
- name: Upload Pages artifact
43-
uses: actions/upload-pages-artifact@v3
47+
uses: actions/upload-pages-artifact@v4
4448
with:
4549
path: docs_build
4650

.github/workflows/build_recipes.yaml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
name: build recipes
1+
name: Build Recipes
2+
23
on:
34
push:
45
branches:
5-
- 'main'
6+
- "main"
67
paths:
7-
- 'recipes/**'
8+
- "recipes/**"
89
pull_request:
910
paths:
10-
- 'recipes/**'
11-
11+
- "recipes/**"
1212

1313
jobs:
1414

1515
build_recipes:
1616
runs-on: ubuntu-latest
1717
env:
18+
FORCE_COLOR: 1
1819
TARGET_PLATFORM: emscripten-wasm32
1920
GITHUB_OWNER: "emscripten-forge"
2021
strategy:
@@ -25,32 +26,25 @@ jobs:
2526
# SETUP
2627
################################################################
2728
- name: Checkout repo
28-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
2930
with:
3031
fetch-depth: 0
3132

32-
- name: Maximize build space
33-
run: |
34-
sudo rm -rf /usr/share/dotnet
35-
sudo rm -rf /opt/ghc
36-
sudo rm -rf "/usr/local/share/boost"
37-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
38-
3933
- name: apt-install playwright dependencies
4034
run: |
41-
sudo apt-get update -y && sudo apt-get install -y \
42-
libwoff1 libvpx9 libevent-2.1-7t64 libopus0 libgstreamer-plugins-base1.0-0 \
43-
libgstreamer-gl1.0-0 \
44-
libgstreamer-plugins-bad1.0-0 \
45-
libflite1 \
46-
libavif16 \
47-
libharfbuzz-icu0 \
48-
libsecret-1-0 \
49-
libhyphen0 \
50-
libmanette-0.2-0 \
51-
libgles2 \
52-
gstreamer1.0-libav \
53-
libgtk-4-1
35+
sudo apt-get update -y && sudo apt-get install -y \
36+
libwoff1 libvpx9 libevent-2.1-7t64 libopus0 libgstreamer-plugins-base1.0-0 \
37+
libgstreamer-gl1.0-0 \
38+
libgstreamer-plugins-bad1.0-0 \
39+
libflite1 \
40+
libavif16 \
41+
libharfbuzz-icu0 \
42+
libsecret-1-0 \
43+
libhyphen0 \
44+
libmanette-0.2-0 \
45+
libgles2 \
46+
gstreamer1.0-libav \
47+
libgtk-4-1
5448
################################################################
5549
# CONFIG
5650
################################################################
@@ -62,14 +56,12 @@ jobs:
6256
# MAMBA
6357
################################################################
6458
- name: Install micromamba
65-
uses: mamba-org/setup-micromamba@v1
59+
uses: mamba-org/setup-micromamba@v2
6660
with:
67-
micromamba-version: '1.5.8-0'
6861
environment-file: ci_env.yml
69-
environment-name: ci
7062
init-shell: bash
7163
cache-environment: false
72-
post-cleanup: 'all'
64+
post-cleanup: "all"
7365

7466
################################################################
7567
# PUSH
@@ -113,7 +105,7 @@ jobs:
113105
--channel emscripten-forge-dev \
114106
-a $PREFIX_DEV_API_KEY \
115107
${package}
116-
108+
117109
RETURNCODE=$?
118110
119111
# Check the RETURN CODE
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Copilot Setup
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
29+
- name: Checkout repo
30+
uses: actions/checkout@v5
31+
with:
32+
fetch-depth: 0
33+
- uses: prefix-dev/setup-pixi@v0.9.0

.github/workflows/delete_package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ def main():
66
parser = argparse.ArgumentParser(description='Delete a package from prefix.dev')
77
parser.add_argument('--token', required=True, help='API token')
88
parser.add_argument('--package', required=True, help='Package file name')
9-
9+
parser.add_argument('--channel', required=True, help='Package file name')
1010
args = parser.parse_args()
1111

1212
token = args.token
1313
package_file_name = args.package
14+
channel = args.channel
1415

1516
base_url = "https://prefix.dev/api/v1"
16-
channel = "emscripten-forge-dev"
1717
subdir = "emscripten-wasm32"
1818
headers = {"Authorization": f"Bearer {token}"}
1919
delete_url = f"{base_url}/delete/{channel}/{subdir}/{package_file_name}"

.github/workflows/delete_package.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ on:
77
description: Name of the package to be deleted
88
required: true
99
default: myBadPackage-9.4.0-py313h6e18b15_0.tar.bz2
10+
channel_name:
11+
description: Name of the channel
12+
required: true
13+
default: emscripten-forge-dev
1014

1115
jobs:
1216
delete_package:
1317
runs-on: ubuntu-latest
1418
steps:
1519
- name: Checkout repo
16-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
1721

1822
- name: Install micromamba
1923
uses: mamba-org/setup-micromamba@v2
@@ -29,7 +33,10 @@ jobs:
2933
env:
3034
PREFIX_DEV_API_KEY: ${{ secrets.PREFIX_DEV_API_KEY }}
3135
PACKAGE_NAME: ${{ github.event.inputs.package_name }}
36+
CHANNEL_NAME: ${{ github.event.inputs.channel_name }}
3237
run: |
3338
python .github/workflows/delete_package.py \
34-
--token "$PREFIX_DEV_API_KEY" --package "$PACKAGE_NAME"
39+
--token "$PREFIX_DEV_API_KEY" \
40+
--package "$PACKAGE_NAME" \
41+
--channel "$CHANNEL_NAME"
3542
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint Recipes
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- "recipes/**"
9+
pull_request:
10+
paths:
11+
- "recipes/**"
12+
13+
jobs:
14+
lint_recipes:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.sha }}
22+
23+
- name: Fetch main branch
24+
run: git fetch origin main
25+
26+
- name: Install micromamba
27+
uses: mamba-org/setup-micromamba@v2
28+
with:
29+
environment-file: ci_env.yml
30+
init-shell: bash
31+
post-cleanup: "all"
32+
33+
- name: Lint recipes
34+
shell: bash -el {0}
35+
run: |
36+
set -e
37+
38+
if [ "${{ github.event_name }}" = "pull_request" ]; then
39+
BASE_REF="origin/main"
40+
HEAD_REF="HEAD"
41+
else
42+
BASE_REF="HEAD~1"
43+
HEAD_REF="HEAD"
44+
fi
45+
46+
echo "Comparing changes between $BASE_REF and $HEAD_REF"
47+
python -m emci build lint $BASE_REF $HEAD_REF

0 commit comments

Comments
 (0)