Skip to content

Commit 6fc27dd

Browse files
committed
Enable conda tests.
1 parent f8f6b30 commit 6fc27dd

File tree

7 files changed

+168
-5
lines changed

7 files changed

+168
-5
lines changed

.github/actions_build_conda.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# This file is managed by 'repo_helper'. Don't edit it directly.
3+
4+
set -e -x
5+
6+
python -m repo_helper make-recipe || exit 1
7+
8+
# Switch to miniconda
9+
source "/home/runner/miniconda/etc/profile.d/conda.sh"
10+
hash -r
11+
conda activate base
12+
conda config --set always_yes yes --set changeps1 no
13+
conda update -q conda
14+
conda install conda-build
15+
conda install anaconda-client
16+
conda info -a
17+
18+
conda config --add channels conda-forge || exit 1
19+
conda config --add channels domdfcoding || exit 1
20+
21+
conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist --skip-existing
22+
23+
exit 0

.github/actions_deploy_conda.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# This file is managed by 'repo_helper'. Don't edit it directly.
3+
4+
set -e -x
5+
6+
# Switch to miniconda
7+
source "/home/runner/miniconda/etc/profile.d/conda.sh"
8+
hash -r
9+
conda activate base
10+
conda config --set always_yes yes --set changeps1 no
11+
conda update -q conda
12+
conda install anaconda-client
13+
conda info -a
14+
15+
for f in conda/dist/noarch/sphinx-autofixture-*.tar.bz2; do
16+
[ -e "$f" ] || continue
17+
echo "$f"
18+
conda install "$f" || exit 1
19+
echo "Deploying to Anaconda.org..."
20+
anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1
21+
echo "Successfully deployed to Anaconda.org."
22+
done
23+
24+
exit 0

.github/workflows/conda_ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This file is managed by 'repo_helper'. Don't edit it directly.
2+
---
3+
name: Conda Tests
4+
5+
on:
6+
push:
7+
pull_request:
8+
branches: ["master"]
9+
10+
jobs:
11+
tests:
12+
name: "Conda"
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout 🛎️
17+
uses: "actions/checkout@v2"
18+
19+
- name: Setup Python 🐍
20+
uses: "actions/setup-python@v2"
21+
with:
22+
python-version: "3.8"
23+
24+
- name: Install dependencies 🔧
25+
run: |
26+
python -VV
27+
python -m site
28+
python -m pip install --upgrade pip setuptools wheel
29+
python -m pip install --upgrade repo_helper
30+
# $CONDA is an environment variable pointing to the root of the miniconda directory
31+
$CONDA/bin/conda update -q conda
32+
$CONDA/bin/conda install conda-build
33+
34+
$CONDA/bin/conda config --add channels conda-forge
35+
$CONDA/bin/conda config --add channels domdfcoding
36+
37+
- name: "Build and install package"
38+
run: |
39+
# This mess is only necessary because conda won't fix it themselves
40+
# https://github.com/conda/conda/issues/1884
41+
42+
python -m repo_helper build --conda --out-dir conda-bld/noarch
43+
$CONDA/bin/conda index ./conda-bld || exit 1
44+
$CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-autofixture -y || exit 1

.github/workflows/python_ci_linux.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,38 @@ jobs:
129129
user: __token__
130130
password: ${{ secrets.PYPI_TOKEN }}
131131
skip_existing: true
132+
133+
134+
135+
Conda:
136+
needs: deploy
137+
runs-on: "ubuntu-20.04"
138+
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true)
139+
steps:
140+
- name: Checkout 🛎️
141+
uses: "actions/checkout@v2"
142+
143+
- name: Setup Python 🐍
144+
uses: "actions/setup-python@v2"
145+
with:
146+
python-version: 3.8
147+
148+
- name: Install dependencies 🔧
149+
run: |
150+
python -m pip install --upgrade pip setuptools wheel
151+
python -m pip install --upgrade repo_helper
152+
153+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
154+
bash miniconda.sh -b -p $HOME/miniconda
155+
156+
- name: Build Conda 📦
157+
run: |
158+
chmod +x .github/actions_build_conda.sh
159+
bash .github/actions_build_conda.sh
160+
161+
- name: Deploy Conda 🚀
162+
run: |
163+
chmod +x .github/actions_deploy_conda.sh
164+
bash .github/actions_deploy_conda.sh
165+
env:
166+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}

README.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ sphinx-autofixture
2121
- |actions_linux| |actions_windows| |actions_macos| |coveralls|
2222
* - PyPI
2323
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
24+
* - Anaconda
25+
- |conda-version| |conda-platform|
2426
* - Activity
2527
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
2628
* - QA
@@ -84,6 +86,14 @@ sphinx-autofixture
8486
:target: https://pypi.org/project/sphinx-autofixture/
8587
:alt: PyPI - Wheel
8688

89+
.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/sphinx-autofixture?logo=anaconda
90+
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
91+
:alt: Conda - Package Version
92+
93+
.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/sphinx-autofixture?label=conda%7Cplatform
94+
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
95+
:alt: Conda - Platform
96+
8797
.. |license| image:: https://img.shields.io/github/license/sphinx-toolbox/sphinx-autofixture
8898
:target: https://github.com/sphinx-toolbox/sphinx-autofixture/blob/master/LICENSE
8999
:alt: License
@@ -117,12 +127,27 @@ Installation
117127

118128
.. start installation
119129
120-
``sphinx-autofixture`` can be installed from PyPI.
130+
``sphinx-autofixture`` can be installed from PyPI or Anaconda.
121131

122132
To install with ``pip``:
123133

124134
.. code-block:: bash
125135
126136
$ python -m pip install sphinx-autofixture
127137
138+
To install with ``conda``:
139+
140+
* First add the required channels
141+
142+
.. code-block:: bash
143+
144+
$ conda config --add channels http://conda.anaconda.org/conda-forge
145+
$ conda config --add channels http://conda.anaconda.org/domdfcoding
146+
147+
* Then install
148+
149+
.. code-block:: bash
150+
151+
$ conda install sphinx-autofixture
152+
128153
.. end installation

doc-source/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ sphinx-autofixture
2020
- |actions_linux| |actions_windows| |actions_macos| |coveralls|
2121
* - PyPI
2222
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
23+
* - Anaconda
24+
- |conda-version| |conda-platform|
2325
* - Activity
2426
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
2527
* - QA
@@ -84,6 +86,14 @@ sphinx-autofixture
8486
:wheel:
8587
:alt: PyPI - Wheel
8688

89+
.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/sphinx-autofixture?logo=anaconda
90+
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
91+
:alt: Conda - Package Version
92+
93+
.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/sphinx-autofixture?label=conda%7Cplatform
94+
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
95+
:alt: Conda - Platform
96+
8797
.. |license| github-shield::
8898
:license:
8999
:alt: License
@@ -121,6 +131,8 @@ Installation
121131
.. installation:: sphinx-autofixture
122132
:pypi:
123133
:github:
134+
:anaconda:
135+
:conda-channels: conda-forge, domdfcoding
124136

125137
.. end installation
126138

repo_helper.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ author: 'Dominic Davis-Foster'
66
email: 'dominic@davis-foster.co.uk'
77
username: "sphinx-toolbox"
88
assignee: "domdfcoding"
9+
primary_conda_channel: 'domdfcoding'
910
version: '0.2.1'
1011
license: 'MIT'
1112
short_desc: 'Sphinx autodocumenter for pytest fixtures.'
1213

13-
enable_conda: false
14-
1514
python_versions:
1615
- 3.6
1716
- 3.7
1817
- 3.8
1918
- 3.9
2019

21-
2220
sphinx_html_theme: furo
23-
2421
standalone_contrib_guide: true
2522

23+
conda_channels:
24+
- conda-forge
25+
2626
extra_sphinx_extensions:
2727
- sphinx_autofixture
2828

0 commit comments

Comments
 (0)