From 51912ca027720ff1148a7609ec6cdfc1fb3340b1 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Fri, 27 Feb 2026 10:05:23 +0000 Subject: [PATCH 1/3] feat(ci): publish CodeEntropy to CCPBioSim Anaconda org on release --- .github/workflows/release.yaml | 43 +++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 1 + conda-recipe/meta.yaml | 47 ++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 conda-recipe/meta.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 05102594..22b5a8a1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -146,3 +146,46 @@ jobs: env: FLIT_USERNAME: __token__ FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + + conda: + name: publish conda to anaconda.org + needs: [tag, release] + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: main + + - name: Set version in conda recipe + run: | + sed -i -E "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml + + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-variant: Miniforge3 + python-version: "3.12" + auto-activate-base: false + + - name: Install build tools + shell: bash -l {0} + run: | + conda install -y conda-build anaconda-client + conda config --add channels conda-forge + conda config --set channel_priority strict + conda config --set anaconda_upload no + + - name: Build package + shell: bash -l {0} + run: | + conda build conda-recipe + + - name: Upload to Anaconda + shell: bash -l {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + PKG_PATH=$(conda build conda-recipe --output) + anaconda -t "$ANACONDA_API_TOKEN" upload "$PKG_PATH" --user CCPBioSim --force diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca087bfa..791650a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,7 @@ repos: - id: check-added-large-files - id: check-merge-conflict - id: check-yaml + exclude: ^conda-recipe/meta\.yaml$ - id: check-toml - id: check-case-conflict - id: check-ast diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml new file mode 100644 index 00000000..29059829 --- /dev/null +++ b/conda-recipe/meta.yaml @@ -0,0 +1,47 @@ +{% set name = "CodeEntropy" %} +{% set version = "0.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + path: .. + +build: + noarch: python + script: python -m pip install . -vv --no-deps + entry_points: + - CodeEntropy=CodeEntropy.cli:main + +requirements: + host: + - python >=3.11 + - pip + - flit-core >=3.4,<4 + run: + - python >=3.11 + - numpy >=2.3,<3.0 + - mdanalysis >=2.10,<3.0 + - pandas >=3.0,<3.1 + - psutil >=7.1,<8.0 + - pyyaml >=6.0,<7.0 + - python-json-logger >=4.0,<5.0 + - rich >=14.2,<15.0 + - art >=6.5,<7.0 + - networkx >=3.6,<3.7 + - matplotlib >=3.10,<3.11 + - waterentropy >=2,<2.1 + - requests >=2.32,<3.0 + +test: + imports: + - CodeEntropy + commands: + - CodeEntropy --help + +about: + home: https://ccpbiosim.github.io/CodeEntropy/ + license: MIT + license_file: LICENSE + summary: "Entropy analysis tools for macromolecular systems and MD simulation" From 3ec85993e6bd6c47332afba07c5fda5163fa60ca Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Fri, 27 Feb 2026 10:31:48 +0000 Subject: [PATCH 2/3] docs: add conda installation and developer environment guidance --- conda-recipe/meta.yaml | 2 +- docs/developer_guide.rst | 9 ++++++++- docs/getting_started.rst | 26 +++++++++++++++++++++++++- pyproject.toml | 2 +- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 29059829..f87d6100 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -16,7 +16,7 @@ build: requirements: host: - - python >=3.11 + - python >=3.12 - pip - flit-core >=3.4,<4 run: diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index d747b563..cb867ae6 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -9,12 +9,19 @@ the continuous integration workflows. Getting Started for Developers ------------------------------ -Create a virtual environment:: +Create a development environment using either venv or Conda. + +Using venv:: python -m venv codeentropy-dev source codeentropy-dev/bin/activate # Linux/macOS codeentropy-dev\Scripts\activate # Windows +Using Conda:: + + conda create -n codeentropy-dev python=3.14 + conda activate codeentropy-dev + Clone the repository:: git clone https://github.com/CCPBioSim/CodeEntropy.git diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 2f300213..51f7b207 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -23,13 +23,37 @@ Requirements Installation ------------ -To install the released version: +CodeEntropy can be installed using either pip or Conda. + +Install with pip +^^^^^^^^^^^^^^^^ + +To install the released version from PyPI: .. code-block:: bash pip install CodeEntropy +Install with Conda +^^^^^^^^^^^^^^^^^^ + +CodeEntropy is also available via the CCPBioSim Anaconda channel. + +Create a dedicated environment: + +.. code-block:: bash + + conda create -n codeentropy python=3.14 + conda activate codeentropy + +Install CodeEntropy: + +.. code-block:: bash + + conda install -c conda-forge -c CCPBioSim CodeEntropy + + Input Files ----------- diff --git a/pyproject.toml b/pyproject.toml index 4d8ba438..16bf3530 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ "Development Status :: 5 - Production/Stable" ] keywords = ["entropy", "macromolecular systems", "MD simulation"] -requires-python = ">=3.11" +requires-python = ">=3.12" dependencies = [ "numpy>=2.3,<3.0", "mdanalysis>=2.10,<3.0", From 2cf79fca30dd4f0624a1f2730cdf5f8e92ed97bd Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Fri, 27 Feb 2026 10:33:13 +0000 Subject: [PATCH 3/3] ensure logo path within `README.md` is correct --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00a9a818..db32d17b 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ CodeEntropy 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.

- CodeEntropy logo - CodeEntropy logo + CodeEntropy logo + CodeEntropy logo

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