Skip to content

Commit 17cd37e

Browse files
authored
Merge pull request #287 from CCPBioSim/284-feature-add-automated-conda-upload
Add automated Conda publishing to release workflow
2 parents b49595a + 2cf79fc commit 17cd37e

7 files changed

Lines changed: 127 additions & 5 deletions

File tree

.github/workflows/release.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,46 @@ jobs:
146146
env:
147147
FLIT_USERNAME: __token__
148148
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
149+
150+
conda:
151+
name: publish conda to anaconda.org
152+
needs: [tag, release]
153+
runs-on: ubuntu-24.04
154+
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v4
158+
with:
159+
ref: main
160+
161+
- name: Set version in conda recipe
162+
run: |
163+
sed -i -E "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml
164+
165+
- name: Setup Conda
166+
uses: conda-incubator/setup-miniconda@v3
167+
with:
168+
miniforge-variant: Miniforge3
169+
python-version: "3.12"
170+
auto-activate-base: false
171+
172+
- name: Install build tools
173+
shell: bash -l {0}
174+
run: |
175+
conda install -y conda-build anaconda-client
176+
conda config --add channels conda-forge
177+
conda config --set channel_priority strict
178+
conda config --set anaconda_upload no
179+
180+
- name: Build package
181+
shell: bash -l {0}
182+
run: |
183+
conda build conda-recipe
184+
185+
- name: Upload to Anaconda
186+
shell: bash -l {0}
187+
env:
188+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
189+
run: |
190+
PKG_PATH=$(conda build conda-recipe --output)
191+
anaconda -t "$ANACONDA_API_TOKEN" upload "$PKG_PATH" --user CCPBioSim --force

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ repos:
1212
- id: check-added-large-files
1313
- id: check-merge-conflict
1414
- id: check-yaml
15+
exclude: ^conda-recipe/meta\.yaml$
1516
- id: check-toml
1617
- id: check-case-conflict
1718
- id: check-ast

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ CodeEntropy
1313
CodeEntropy is a Python package for computing the configurational entropy of macromolecular systems using forces sampled from molecular dynamics (MD) simulations. It implements the multiscale cell correlation method to provide accurate and efficient entropy estimates, supporting a wide range of applications in molecular simulation and statistical mechanics.
1414

1515
<p align="center">
16-
<img src="docs/images/biosim-codeentropy_logo_light.png#gh-light-mode-only" alt="CodeEntropy logo" width="300"/>
17-
<img src="docs/images/biosim-codeentropy_logo_dark.png#gh-dark-mode-only" alt="CodeEntropy logo" width="300"/>
16+
<img src="docs/_static/logos/biosim-codeentropy_logo_light.png#gh-light-mode-only" alt="CodeEntropy logo" width="300"/>
17+
<img src="docs/_static/logos/biosim-codeentropy_logo_dark.png#gh-dark-mode-only" alt="CodeEntropy logo" width="300"/>
1818
</p>
1919

2020
See [CodeEntropy’s documentation](https://codeentropy.readthedocs.io/en/latest/) for more information.

conda-recipe/meta.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{% set name = "CodeEntropy" %}
2+
{% set version = "0.0.0" %}
3+
4+
package:
5+
name: {{ name }}
6+
version: {{ version }}
7+
8+
source:
9+
path: ..
10+
11+
build:
12+
noarch: python
13+
script: python -m pip install . -vv --no-deps
14+
entry_points:
15+
- CodeEntropy=CodeEntropy.cli:main
16+
17+
requirements:
18+
host:
19+
- python >=3.12
20+
- pip
21+
- flit-core >=3.4,<4
22+
run:
23+
- python >=3.11
24+
- numpy >=2.3,<3.0
25+
- mdanalysis >=2.10,<3.0
26+
- pandas >=3.0,<3.1
27+
- psutil >=7.1,<8.0
28+
- pyyaml >=6.0,<7.0
29+
- python-json-logger >=4.0,<5.0
30+
- rich >=14.2,<15.0
31+
- art >=6.5,<7.0
32+
- networkx >=3.6,<3.7
33+
- matplotlib >=3.10,<3.11
34+
- waterentropy >=2,<2.1
35+
- requests >=2.32,<3.0
36+
37+
test:
38+
imports:
39+
- CodeEntropy
40+
commands:
41+
- CodeEntropy --help
42+
43+
about:
44+
home: https://ccpbiosim.github.io/CodeEntropy/
45+
license: MIT
46+
license_file: LICENSE
47+
summary: "Entropy analysis tools for macromolecular systems and MD simulation"

docs/developer_guide.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ the continuous integration workflows.
99
Getting Started for Developers
1010
------------------------------
1111

12-
Create a virtual environment::
12+
Create a development environment using either venv or Conda.
13+
14+
Using venv::
1315

1416
python -m venv codeentropy-dev
1517
source codeentropy-dev/bin/activate # Linux/macOS
1618
codeentropy-dev\Scripts\activate # Windows
1719

20+
Using Conda::
21+
22+
conda create -n codeentropy-dev python=3.14
23+
conda activate codeentropy-dev
24+
1825
Clone the repository::
1926

2027
git clone https://github.com/CCPBioSim/CodeEntropy.git

docs/getting_started.rst

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,37 @@ Requirements
2323
Installation
2424
------------
2525

26-
To install the released version:
26+
CodeEntropy can be installed using either pip or Conda.
27+
28+
Install with pip
29+
^^^^^^^^^^^^^^^^
30+
31+
To install the released version from PyPI:
2732

2833
.. code-block:: bash
2934
3035
pip install CodeEntropy
3136
3237
38+
Install with Conda
39+
^^^^^^^^^^^^^^^^^^
40+
41+
CodeEntropy is also available via the CCPBioSim Anaconda channel.
42+
43+
Create a dedicated environment:
44+
45+
.. code-block:: bash
46+
47+
conda create -n codeentropy python=3.14
48+
conda activate codeentropy
49+
50+
Install CodeEntropy:
51+
52+
.. code-block:: bash
53+
54+
conda install -c conda-forge -c CCPBioSim CodeEntropy
55+
56+
3357
Input Files
3458
-----------
3559

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ classifiers = [
3535
"Development Status :: 5 - Production/Stable"
3636
]
3737
keywords = ["entropy", "macromolecular systems", "MD simulation"]
38-
requires-python = ">=3.11"
38+
requires-python = ">=3.12"
3939
dependencies = [
4040
"numpy>=2.3,<3.0",
4141
"mdanalysis>=2.10,<3.0",

0 commit comments

Comments
 (0)