Skip to content

Commit

Permalink
Enable conda tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Dec 26, 2020
1 parent f8f6b30 commit 6fc27dd
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .github/actions_build_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# This file is managed by 'repo_helper'. Don't edit it directly.

set -e -x

python -m repo_helper make-recipe || exit 1

# Switch to miniconda
source "/home/runner/miniconda/etc/profile.d/conda.sh"
hash -r
conda activate base
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda install conda-build
conda install anaconda-client
conda info -a

conda config --add channels conda-forge || exit 1
conda config --add channels domdfcoding || exit 1

conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist --skip-existing

exit 0
24 changes: 24 additions & 0 deletions .github/actions_deploy_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# This file is managed by 'repo_helper'. Don't edit it directly.

set -e -x

# Switch to miniconda
source "/home/runner/miniconda/etc/profile.d/conda.sh"
hash -r
conda activate base
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda install anaconda-client
conda info -a

for f in conda/dist/noarch/sphinx-autofixture-*.tar.bz2; do
[ -e "$f" ] || continue
echo "$f"
conda install "$f" || exit 1
echo "Deploying to Anaconda.org..."
anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1
echo "Successfully deployed to Anaconda.org."
done

exit 0
44 changes: 44 additions & 0 deletions .github/workflows/conda_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file is managed by 'repo_helper'. Don't edit it directly.
---
name: Conda Tests

on:
push:
pull_request:
branches: ["master"]

jobs:
tests:
name: "Conda"
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: "actions/checkout@v2"

- name: Setup Python 🐍
uses: "actions/setup-python@v2"
with:
python-version: "3.8"

- name: Install dependencies 🔧
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade repo_helper
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda update -q conda
$CONDA/bin/conda install conda-build
$CONDA/bin/conda config --add channels conda-forge
$CONDA/bin/conda config --add channels domdfcoding
- name: "Build and install package"
run: |
# This mess is only necessary because conda won't fix it themselves
# https://github.com/conda/conda/issues/1884
python -m repo_helper build --conda --out-dir conda-bld/noarch
$CONDA/bin/conda index ./conda-bld || exit 1
$CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-autofixture -y || exit 1
35 changes: 35 additions & 0 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,38 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true



Conda:
needs: deploy
runs-on: "ubuntu-20.04"
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true)
steps:
- name: Checkout 🛎️
uses: "actions/checkout@v2"

- name: Setup Python 🐍
uses: "actions/setup-python@v2"
with:
python-version: 3.8

- name: Install dependencies 🔧
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade repo_helper
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
- name: Build Conda 📦
run: |
chmod +x .github/actions_build_conda.sh
bash .github/actions_build_conda.sh
- name: Deploy Conda 🚀
run: |
chmod +x .github/actions_deploy_conda.sh
bash .github/actions_deploy_conda.sh
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
27 changes: 26 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ sphinx-autofixture
- |actions_linux| |actions_windows| |actions_macos| |coveralls|
* - PyPI
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
* - Anaconda
- |conda-version| |conda-platform|
* - Activity
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
* - QA
Expand Down Expand Up @@ -84,6 +86,14 @@ sphinx-autofixture
:target: https://pypi.org/project/sphinx-autofixture/
:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/sphinx-autofixture?logo=anaconda
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
:alt: Conda - Package Version

.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/sphinx-autofixture?label=conda%7Cplatform
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
:alt: Conda - Platform

.. |license| image:: https://img.shields.io/github/license/sphinx-toolbox/sphinx-autofixture
:target: https://github.com/sphinx-toolbox/sphinx-autofixture/blob/master/LICENSE
:alt: License
Expand Down Expand Up @@ -117,12 +127,27 @@ Installation

.. start installation
``sphinx-autofixture`` can be installed from PyPI.
``sphinx-autofixture`` can be installed from PyPI or Anaconda.

To install with ``pip``:

.. code-block:: bash
$ python -m pip install sphinx-autofixture
To install with ``conda``:

* First add the required channels

.. code-block:: bash
$ conda config --add channels http://conda.anaconda.org/conda-forge
$ conda config --add channels http://conda.anaconda.org/domdfcoding
* Then install

.. code-block:: bash
$ conda install sphinx-autofixture
.. end installation
12 changes: 12 additions & 0 deletions doc-source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ sphinx-autofixture
- |actions_linux| |actions_windows| |actions_macos| |coveralls|
* - PyPI
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
* - Anaconda
- |conda-version| |conda-platform|
* - Activity
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
* - QA
Expand Down Expand Up @@ -84,6 +86,14 @@ sphinx-autofixture
:wheel:
:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/sphinx-autofixture?logo=anaconda
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
:alt: Conda - Package Version

.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/sphinx-autofixture?label=conda%7Cplatform
:target: https://anaconda.org/domdfcoding/sphinx-autofixture
:alt: Conda - Platform

.. |license| github-shield::
:license:
:alt: License
Expand Down Expand Up @@ -121,6 +131,8 @@ Installation
.. installation:: sphinx-autofixture
:pypi:
:github:
:anaconda:
:conda-channels: conda-forge, domdfcoding

.. end installation
Expand Down
8 changes: 4 additions & 4 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ author: 'Dominic Davis-Foster'
email: '[email protected]'
username: "sphinx-toolbox"
assignee: "domdfcoding"
primary_conda_channel: 'domdfcoding'
version: '0.2.1'
license: 'MIT'
short_desc: 'Sphinx autodocumenter for pytest fixtures.'

enable_conda: false

python_versions:
- 3.6
- 3.7
- 3.8
- 3.9


sphinx_html_theme: furo

standalone_contrib_guide: true

conda_channels:
- conda-forge

extra_sphinx_extensions:
- sphinx_autofixture

Expand Down

0 comments on commit 6fc27dd

Please sign in to comment.