Skip to content

Commit e105d6a

Browse files
wolfvjaimergp
andauthored
add pixi.toml (#2546)
* add pixi.toml * Update Pixi setup with tasks and platforms * Use Pixi in CI (GHA and Netlify) * update environment.yml * explicit paths for pixi install in netlify * Update contribution guidelines * it's build-production * Re-add install to `pixi run start` * Update links * and here * Fix anchor links * Check requirements are in sync * prettier: ignore .ci_scripts/environment.yml * Tiny details --------- Co-authored-by: jaimergp <[email protected]>
1 parent aa380a0 commit e105d6a

File tree

12 files changed

+118
-54
lines changed

12 files changed

+118
-54
lines changed

.ci_scripts/environment.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: conda-forge-docs
22
channels:
3-
- conda-forge
3+
- conda-forge
4+
- nodefaults
45
dependencies:
5-
- python=3
6-
- requests
7-
- pip
8-
- nodejs 20.*
9-
- pre-commit
6+
- curl *
7+
- nodejs 24.*
8+
- pre-commit *
9+
- python 3.*
10+
- requests *

.github/workflows/deploy.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1616

17-
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
18-
with:
19-
python-version: 3.8
20-
channels: conda-forge
21-
channel-priority: strict
22-
show-channel-urls: true
23-
miniforge-version: latest
24-
activate-environment: conda-forge-docs
25-
environment-file: .ci_scripts/environment.yml
17+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
2618

2719
- name: build
28-
shell: bash -l {0}
29-
run: |
30-
source ./.ci_scripts/update_docs
20+
run: pixi run build-production
3121
env:
3222
GHREF: ${{ github.ref }}
3323
GHREPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
@@ -64,3 +54,12 @@ jobs:
6454
--remap "https://conda-forge.org/(.*) file://$(pwd)/build/\$1"
6555
'./build/**/*.html'
6656
'*.md'
57+
58+
- name: Check Pixi and environment.yml are in sync
59+
run: |
60+
pixi workspace export conda-environment > .ci_scripts/environment.yml
61+
sed -i -e 's/name: default/name: conda-forge-docs/g' -e '/^$/d' .ci_scripts/environment.yml
62+
if ! git diff --exit-code .ci_scripts/environment.yml; then
63+
echo "error: pixi.toml and environment.yml are out of sync"
64+
exit 1
65+
fi

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ yarn-error.log*
5454
# pyc files
5555
*.pyc
5656
__pycache__/
57+
*.egg-info
58+
59+
# pixi environments and lockfiles
60+
.pixi
61+
pixi.lock
5762

5863
# vscode stuff
5964
.vscode

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ static/
1111
.github/
1212
vote-results/
1313
misc/
14+
*.mdx
15+
.ci_scripts/environment.yml

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ If you have questions or need help, please check out our documentation for a [li
2121

2222
1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the [conda-forge.github.io](https://github.com/conda-forge/conda-forge.github.io) repository to your own GitHub user account.
2323
2. [Clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) this fork onto your computer.
24-
3. Go into the main folder.
25-
Run the following commands.
26-
- `conda env create -f ./.ci_scripts/environment.yml`
27-
- `conda activate conda-forge-docs`
28-
- For live builds, `npm install && npm run start`
29-
- For production builds, run `.ci_scripts/update_docs`
24+
3. Go into the cloned folder and:
25+
- If you are using `pixi`:
26+
- Use `pixi run start` for live builds
27+
- Use `pixi run build-production` for production builds
28+
- If you are using `conda` or `mamba` (replace command accordingly):
29+
- `conda env create -f ./.ci_scripts/environment.yml`
30+
- `conda activate conda-forge-docs`
31+
- For live builds, `npm install && npm run start`
32+
- For production builds, run `.ci_scripts/update_docs`
3033
4. Make and commit your changes.
3134
5. Submit a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) to the main repository proposing your changes.
3235

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Chances are we have already packaged it for you. You can [search](https://anacon
2323
- [Contribute new packages](maintainer/adding_pkgs.md)
2424
- Help update and [maintain packages](maintainer/updating_pkgs.md)
2525
- Suggest or implement improvements for our [infrastructure](maintainer/infrastructure.md)
26-
- Help [improve the documentation](user/contributing.md#improve-docs)
27-
- For a detailed overview please refer to [Becoming involved](user/contributing.md)
26+
- Help [improve the documentation](/docs/user/contributing/#improve-the-website)
27+
- For a detailed overview please refer to [Becoming involved](user/contributing.mdx)
2828
- To see our governance policies, see [Governance](/community/governance/).
2929
- If you find bugs, need help, or want to talk to the developers, use our mailing lists or chat rooms:
3030
- [GitHub issues](https://github.com/conda-forge/conda-forge.github.io/issues)

docs/maintainer/infrastructure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The current [conda-forge.org](https://conda-forge.org) is a statically generated
138138

139139
The documentation is built with Docusaurus and the source files are located in the [`docs/`](https://github.com/conda-forge/conda-forge.github.io/tree/main/docs) directory of the repository.
140140

141-
If you find any typos, errors, unclear explanations, or new topics that can be covered, you can suggest changes to the documentation. For more details, please refer to [Improve the documentation](../user/contributing.md#improve-docs).
141+
If you find any typos, errors, unclear explanations, or new topics that can be covered, you can suggest changes to the documentation. For more details, please refer to [Improve the documentation](/docs/user/contributing/#improve-the-website).
142142

143143
In addition to the static documentation, the website also offers information on the current status of conda-forge as well as a mapping of packages to feedstocks.
144144

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
title: 'Becoming involved'
33
---
44

5-
<a id="becoming-involved"></a>
5+
import Tabs from '@theme/Tabs';
6+
import TabItem from '@theme/TabItem';
67

78
<a id="id1"></a>
89

@@ -81,25 +82,30 @@ If you are new to the conda-forge community, follow the steps below to make your
8182
```
8283
git checkout -b <new-branch-name>
8384
```
84-
4. Run the following commands:
85-
```
86-
conda env create -f ./.ci_scripts/environment.yml
87-
```
88-
conda activate conda-forge-docs
89-
5. While writing your new documentation, you can use the live preview mode with:
90-
- `npm install` to make sure `node_modules` is up-to-date
91-
- `npm run start` to start the live preview. Every time you save a file, the changes will be reflected instantaneously.
92-
6. Once ready, you can also check how the production build would look like with the commands:
93-
```
94-
.ci_scripts/update_docs
95-
python -m http.server --directory build/
96-
```
97-
7. Add and commit your changes:
85+
4. Depending on your tool of choice, run these commands to obtain a live preview of the changes:
86+
87+
<Tabs>
88+
<TabItem label="conda, mamba" value="conda">
89+
```
90+
conda env create -f ./.ci_scripts/environment.yml
91+
conda activate conda-forge-docs
92+
npm install
93+
npm run start
94+
```
95+
</TabItem>
96+
<TabItem label="pixi" value="pixi" default="True">
97+
```
98+
pixi run start
99+
```
100+
</TabItem>
101+
</Tabs>
102+
103+
5. Once ready, add and commit your changes:
98104
```
99105
git add .
100106
git commit -m "your commit message"
101107
```
102-
8. Submit a [pull request](https://help.github.com/articles/about-pull-requests/) to the main repository proposing your changes.
108+
6. Submit a [pull request](https://help.github.com/articles/about-pull-requests/) to the main repository proposing your changes.
103109
The CI pipelines will include a PR preview on Netlify.
104110

105111
Happy contributing!

docs/user/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ conda-forge is a community effort that provides conda packages for a wide range
1616

1717
You can [search](https://anaconda.org/) for packages online. Look out for packages provided by our conda-forge organization.
1818

19-
**Cannot find a package or only outdated versions of a package?** - Everybody is welcome to contribute to our package stack! Please refer to [Becoming involved](contributing.md#becoming-involved), for an overview on how to start contributing.
19+
**Cannot find a package or only outdated versions of a package?** - Everybody is welcome to contribute to our package stack! Please refer to [Becoming involved](contributing.mdx), for an overview on how to start contributing.
2020

2121
<a id="why-conda-forge"></a>
2222

netlify.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@
55
publish = "build"
66

77
# Default build command.
8-
command = """
9-
curl -L -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh &&
10-
bash miniforge.sh -bfp ~/miniforge &&
11-
rm -rf miniforge.sh &&
12-
source ~/miniforge/etc/profile.d/conda.sh &&
13-
conda env create -f .ci_scripts/environment.yml &&
14-
conda activate conda-forge-docs &&
15-
./.ci_scripts/update_docs
16-
"""
8+
command = 'curl -fsSL https://pixi.sh/install.sh | PIXI_HOME=~/.pixi sh && ~/.pixi/bin/pixi run build-production'
179

1810
# We only want to build PR previews.
1911
# Exit code == 0 means that the build is ignored.

0 commit comments

Comments
 (0)