Skip to content

Commit

Permalink
chore: move to conda-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Sep 13, 2024
1 parent b987236 commit 925c026
Show file tree
Hide file tree
Showing 10 changed files with 3,160 additions and 74 deletions.
5 changes: 1 addition & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ due to the missing tokens. Once a member of conda-forge/core merges the PR, the
will be run on the upstream repo. If this passes, the PR will get merged into `main`. If not, the PR
will get kicked out of the queue for fixes.
If you have push access to this repo, you can use a branch for your PR, but this will not bypass the
If you have push access to this repo, you can use a branch for your PR, but this will not bypass the
merge queue.
-->

Checklist
* [ ] CI is passing
35 changes: 18 additions & 17 deletions .github/workflows/clean-and-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
- name: setup conda
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
with:
python-version: '3.10'
channels: conda-forge
channel-priority: strict
show-channel-urls: true
environment-file: conda-lock.yml
environment-name: webservices
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
- name: generate token
id: generate_token
Expand All @@ -27,14 +31,19 @@ jobs:
private-key: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: configure conda
- name: relock
uses: beckermr/relock-conda@37dda99dfc45d796d0b2526761856b10ff257d32
with:
github-token: ${{ steps.generate_token.outputs.token }}
automerge: true
skip-if-pr-exists: true

- name: install code
shell: bash -l {0}
run: |
conda config --set show_channel_urls True
conda config --add channels conda-forge
conda install --yes --quiet --file conda-requirements.txt --file conda-test-requirements.txt
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com"
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
env:
Expand All @@ -54,11 +63,3 @@ jobs:
env:
CF_WEBSERVICES_APP_ID: ${{ secrets.CF_CURATOR_APP_ID }}
CF_WEBSERVICES_PRIVATE_KEY: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}

- name: update and redeploy if needed
shell: bash -l {0}
run: |
update-webservices
env:
CF_WEBSERVICES_APP_ID: ${{ secrets.CF_CURATOR_APP_ID }}
CF_WEBSERVICES_PRIVATE_KEY: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}
46 changes: 23 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
- name: setup conda
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
with:
python-version: '3.10'
channels: conda-forge
channel-priority: strict
show-channel-urls: true
miniforge-version: latest
environment-file: conda-lock.yml
environment-name: webservices
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
- name: generate token
id: generate_token
Expand All @@ -38,14 +41,12 @@ jobs:
private-key: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: configure conda
- name: install code
shell: bash -l {0}
run: |
conda config --set show_channel_urls True
conda config --add channels conda-forge
conda install --yes --quiet --file conda-requirements.txt --file conda-test-requirements.txt
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com"
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
env:
Expand Down Expand Up @@ -86,14 +87,17 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
if: ${{ !github.event.pull_request.head.repo.fork }}

- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
- name: setup conda
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
with:
python-version: '3.10'
channels: conda-forge
channel-priority: strict
show-channel-urls: true
miniforge-version: latest
environment-file: conda-lock.yml
environment-name: webservices
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
- name: generate token
if: ${{ !github.event.pull_request.head.repo.fork }}
Expand All @@ -104,13 +108,10 @@ jobs:
private-key: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: configure conda
- name: install code
shell: bash -l {0}
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
conda config --set show_channel_urls True
conda config --add channels conda-forge
conda install --yes --quiet --file conda-requirements.txt --file conda-test-requirements.txt
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com"
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
Expand All @@ -121,11 +122,10 @@ jobs:

- name: run package upload tests
shell: bash -l {0}
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
export CF_WEBSERVICES_TEST=1
if [[ '${{ github.event.pull_request.head.repo.fork }}' != "true" ]]; then
./scripts/run_cfep13_tests.sh
fi
./scripts/run_cfep13_tests.sh
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
PROD_BINSTAR_TOKEN: ${{ secrets.PROD_BINSTAR_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ feedstock-tokens
.vscode/
built_dists/*
recipe/*
.mypy_cache/
.pytest_cache/
.ruff_cache/
built_dists/
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
ADD https://loripsum.net/api /opt/docker/etc/gibberish

# Install conda
COPY conda-requirements.txt /
COPY conda-lock.yml /
RUN echo "**** install dev packages ****" && \
apk add --no-cache bash ca-certificates wget && \
rm -rf /var/cache/apk/* && \
Expand All @@ -56,7 +56,7 @@ RUN echo "**** install dev packages ****" && \
bash miniforge3.sh -f -b -p "$CONDA_DIR" && \
rm -f miniforge3.sh && \
\
echo "**** install base env ****" && \
echo "**** install env ****" && \
source /opt/conda/etc/profile.d/conda.sh && \
conda activate base && \
conda config --set show_channel_urls True && \
Expand All @@ -65,7 +65,8 @@ RUN echo "**** install dev packages ****" && \
conda config --set always_yes yes && \
conda config --set solver libmamba && \
conda update --all --quiet && \
conda install --quiet --file conda-requirements.txt && \
conda install --quiet conda-lock && \
conda-lock install -n webservices /conda-lock.yml && \
conda clean --all --force-pkgs-dirs --yes && \
find "$CONDA_DIR" -follow -type f \( -iname '*.a' -o -iname '*.pyc' -o -iname '*.js.map' \) -delete && \
\
Expand All @@ -78,7 +79,7 @@ RUN mkdir -p conda_forge_webservices
COPY / conda_forge_webservices/
RUN cd conda_forge_webservices && \
source /opt/conda/etc/profile.d/conda.sh && \
conda activate base && \
conda activate webservices && \
pip install -e .

CMD ["/opt/conda/bin/tini", \
Expand Down
Loading

0 comments on commit 925c026

Please sign in to comment.