Skip to content

Commit 79bb199

Browse files
Updated files with 'repo_helper'.
1 parent 18b07e1 commit 79bb199

File tree

5 files changed

+135
-3
lines changed

5 files changed

+135
-3
lines changed

.github/workflows/conda_ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This file is managed by 'repo_helper'. Don't edit it directly.
2+
---
3+
name: Conda Tests
4+
5+
on:
6+
push:
7+
branches: ["master"]
8+
9+
jobs:
10+
tests:
11+
name: "Conda"
12+
permissions:
13+
contents: read
14+
runs-on: ubuntu-22.04
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
19+
steps:
20+
- name: Checkout 🛎️
21+
uses: "actions/checkout@v4"
22+
23+
- name: Setup Python 🐍
24+
uses: "actions/setup-python@v5"
25+
with:
26+
python-version: "3.11"
27+
28+
- name: Setup Conda
29+
uses: conda-incubator/setup-miniconda@v2.1.1
30+
with:
31+
activate-environment: env
32+
conda-build-version: 3.28.4
33+
miniconda-version: py311_24.1.2-0
34+
python-version: "3.11"
35+
miniforge-variant: Mambaforge
36+
37+
- name: Install dependencies 🔧
38+
run: |
39+
python -VV
40+
python -m site
41+
python -m pip install --upgrade pip setuptools wheel
42+
python -m pip install --upgrade "whey-conda" "hatch-requirements-txt"
43+
# $CONDA is an environment variable pointing to the root of the miniconda directory
44+
$CONDA/bin/conda update -n base conda
45+
$CONDA/bin/conda config --add channels conda-forge
46+
$CONDA/bin/conda config --add channels domdfcoding
47+
48+
- name: "Build and index channel"
49+
run: |
50+
python -m whey --builder whey_conda --out-dir conda-bld/noarch
51+
$CONDA/bin/conda index ./conda-bld || exit 1
52+
53+
- name: "Search for package"
54+
run: |
55+
$CONDA/bin/conda search -c file://$(pwd)/conda-bld domdf_python_tools
56+
$CONDA/bin/conda search -c file://$(pwd)/conda-bld --override-channels domdf_python_tools
57+
58+
- name: "Install package"
59+
run: |
60+
$CONDA/bin/conda install -c file://$(pwd)/conda-bld domdf_python_tools=3.10.0=py_1 -y || exit 1
61+
62+
- name: "Run Tests"
63+
run: |
64+
rm -rf domdf_python_tools
65+
$CONDA/bin/conda install pytest coincidence || exit 1
66+
pip install -r tests/requirements.txt
67+
pytest tests/

.github/workflows/python_ci_linux.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,68 @@ jobs:
180180
python .github/milestones.py
181181
env:
182182
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183+
184+
185+
186+
Conda:
187+
needs: deploy
188+
permissions:
189+
contents: read
190+
runs-on: ubuntu-22.04
191+
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true)
192+
steps:
193+
- name: Checkout 🛎️
194+
uses: "actions/checkout@v4"
195+
196+
- name: Setup Python 🐍
197+
uses: "actions/setup-python@v5"
198+
with:
199+
python-version: 3.11
200+
201+
- name: Setup Conda
202+
uses: conda-incubator/setup-miniconda@v2.1.1
203+
with:
204+
activate-environment: env
205+
conda-build-version: 3.28.4
206+
miniconda-version: py311_24.1.2-0
207+
python-version: "3.11"
208+
miniforge-variant: Mambaforge
209+
210+
- name: Install dependencies 🔧
211+
run: |
212+
python -VV
213+
python -m site
214+
python -m pip install --upgrade pip setuptools wheel
215+
python -m pip install --upgrade "mkrecipe" "hatch-requirements-txt"
216+
# $CONDA is an environment variable pointing to the root of the miniconda directory
217+
$CONDA/bin/conda config --set always_yes yes --set changeps1 no
218+
$CONDA/bin/conda update -n base conda
219+
$CONDA/bin/conda info -a
220+
$CONDA/bin/conda install conda-forge::py-lief=0.14.1
221+
$CONDA/bin/conda config --add channels conda-forge
222+
$CONDA/bin/conda config --add channels domdfcoding
223+
224+
$CONDA/bin/conda config --remove channels defaults
225+
226+
- name: Build Conda Package 📦
227+
run: |
228+
python -m mkrecipe --type wheel || exit 1
229+
$CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist
230+
231+
- name: Deploy Conda Package 🚀
232+
if: startsWith(github.ref, 'refs/tags/')
233+
run: |
234+
$CONDA/bin/conda config --set always_yes yes --set changeps1 no
235+
$CONDA/bin/conda install anaconda-client
236+
$CONDA/bin/conda info -a
237+
238+
for f in conda/dist/noarch/domdf_python_tools-*.tar.bz2; do
239+
[ -e "$f" ] || continue
240+
echo "$f"
241+
conda install "$f" || exit 1
242+
echo "Deploying to Anaconda.org..."
243+
$CONDA/bin/anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1
244+
echo "Successfully deployed to Anaconda.org."
245+
done
246+
env:
247+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
- id: end-of-file-fixer
3333

3434
- repo: https://github.com/domdfcoding/pre-commit-hooks
35-
rev: v0.4.0
35+
rev: v0.5.0
3636
hooks:
3737
- id: requirements-txt-sorter
3838
args:
@@ -80,7 +80,7 @@ repos:
8080
- id: snippet-fmt
8181

8282
- repo: https://github.com/python-formate/formate
83-
rev: v0.9.0
83+
rev: v1.1.2
8484
hooks:
8585
- id: formate
8686
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$

formate.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ reformat-generics = 40
55
noqa-reformat = 60
66
ellipsis-reformat = 70
77
squish_stubs = 80
8+
newline_after_equals = 90
89

910
[hooks.yapf]
1011
priority = 30

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ deps =
136136
git+https://github.com/python-formate/flake8-missing-annotations.git
137137
git+https://github.com/domdfcoding/pydocstyle.git@stub-functions
138138
pygments>=2.7.1
139-
importlib_metadata<4.5.0; python_version<'3.8'
140139
commands = python3 -m flake8_rst_docstrings_sphinx domdf_python_tools tests --allow-toolbox {posargs}
141140

142141
[testenv:perflint]

0 commit comments

Comments
 (0)