From 5d19da5ae06ff399b26475d23627e1f0f886006c Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Sat, 16 Nov 2024 14:25:43 +1100 Subject: [PATCH 1/5] update channels --- .../devtools/conda-envs/test_env.yaml | 10 ++++++---- {{cookiecutter.repo_name}}/docs/requirements.yaml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml b/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml index 33f6060f..c739e5ac 100644 --- a/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml +++ b/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml @@ -1,12 +1,14 @@ name: {{cookiecutter.repo_name}}-test -channels:{% if cookiecutter.dependency_source == 'Prefer conda-forge over the default anaconda channel with pip fallback' %} - - conda-forge{% endif %} +channels:{% if cookiecutter.__dependency_source == 'anaconda' %} - defaults +{% elif cookiecutter.__dependency_source == 'conda-forge' %} + - conda-forge +{% endif %} dependencies: # Base depends - python - pip -{% if cookiecutter.dependency_source == 'Prefer conda-forge over the default anaconda channel with pip fallback' %} +{% if cookiecutter.__dependency_source == 'conda-forge' %} # MDAnalysis - MDAnalysis {% endif %} @@ -14,7 +16,7 @@ dependencies: - pytest - pytest-cov - pytest-xdist -{% if cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback' %} +{% if cookiecutter.__dependency_source == 'anaconda' %} # Pip-only installs - pip: - codecov diff --git a/{{cookiecutter.repo_name}}/docs/requirements.yaml b/{{cookiecutter.repo_name}}/docs/requirements.yaml index 051920e1..dfc1a389 100644 --- a/{{cookiecutter.repo_name}}/docs/requirements.yaml +++ b/{{cookiecutter.repo_name}}/docs/requirements.yaml @@ -1,6 +1,6 @@ name: {{cookiecutter.repo_name}}-docs channels: -{% if cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback' %} +{% if if cookiecutter.__dependency_source == 'anaconda' %} - defaults {% else %} - conda-forge From f9ef512319e800dc67307c53019ef69f1d44d6c2 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Sat, 16 Nov 2024 14:27:47 +1100 Subject: [PATCH 2/5] rm extra if --- {{cookiecutter.repo_name}}/docs/requirements.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/docs/requirements.yaml b/{{cookiecutter.repo_name}}/docs/requirements.yaml index dfc1a389..eb35feef 100644 --- a/{{cookiecutter.repo_name}}/docs/requirements.yaml +++ b/{{cookiecutter.repo_name}}/docs/requirements.yaml @@ -1,6 +1,6 @@ name: {{cookiecutter.repo_name}}-docs channels: -{% if if cookiecutter.__dependency_source == 'anaconda' %} +{% if cookiecutter.__dependency_source == 'anaconda' %} - defaults {% else %} - conda-forge From 8a3b9993ac21a63993ae2442615f12da638dcf11 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Sat, 30 May 2026 18:28:55 +1000 Subject: [PATCH 3/5] rm anaconda --- .github/workflows/gh-ci.yaml | 2 +- cookiecutter.json | 6 ++---- docs/source/cookiecutter/json_options.rst | 6 ++---- docs/source/options.rst | 19 +++++-------------- tests/utils.py | 3 +-- .../workflows/{{cookiecutter._ci_name}}.yaml | 4 +--- .../devtools/conda-envs/test_env.yaml | 13 +++---------- {{cookiecutter.repo_name}}/docs/README.md | 4 ++-- .../docs/requirements.yaml | 4 ---- 9 files changed, 17 insertions(+), 44 deletions(-) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 4163f26c..ca329eae 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -160,7 +160,7 @@ jobs: architecture: x64 miniforge-variant: Mambaforge use-mamba: true - channels: conda-forge, defaults + channels: conda-forge activate-environment: cookiecutter-mdakit-docs auto-update-conda: true show-channel-urls: true diff --git a/cookiecutter.json b/cookiecutter.json index f3920de0..81bb6404 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -8,8 +8,7 @@ "author_name": "Your name (or your organization/company/team)", "author_email": "Your email (or your organization/company/team)", "dependency_source": [ - "Prefer conda-forge over the default anaconda channel with pip fallback", - "Prefer default anaconda channel with pip fallback", + "Prefer conda-forge with pip fallback", "Dependencies from pip only (no conda)" ], "include_ReadTheDocs": [ @@ -21,8 +20,7 @@ "_ci_name": "gh-ci", "_central_branch_name": "main", "_dependency_source_keys": { - "Prefer conda-forge over the default anaconda channel with pip fallback": "conda-forge", - "Prefer default anaconda channel with pip fallback": "anaconda", + "Prefer conda-forge with pip fallback": "conda-forge", "Dependencies from pip only (no conda)": "pip" }, "__dependency_source": "{{ cookiecutter._dependency_source_keys[cookiecutter.dependency_source] }}", diff --git a/docs/source/cookiecutter/json_options.rst b/docs/source/cookiecutter/json_options.rst index 45602cc0..0cb92d2e 100644 --- a/docs/source/cookiecutter/json_options.rst +++ b/docs/source/cookiecutter/json_options.rst @@ -32,12 +32,10 @@ They correspond to the following options: :widths: 30 70 :header-rows: 1 - * - __dependency_source + * - __dependency_source - dependency_source * - conda-forge - - Prefer conda-forge over the default anaconda channel with pip fallback - * - anaconda - - Prefer default anaconda channel with pip fallback + - Prefer conda-forge with pip fallback * - pip - Dependencies from pip only (no conda) diff --git a/docs/source/options.rst b/docs/source/options.rst index 157d4ba3..264606db 100644 --- a/docs/source/options.rst +++ b/docs/source/options.rst @@ -97,8 +97,8 @@ dependency_source This option determines which sources to use for dependencies for the package. It affects the continuous integration testing, as well as -the dependency files written. The three choices -(``conda-forge``, ``anaconda``, and ``pip``) +the dependency files written. The two choices +(``conda-forge`` and ``pip``) are explained below. **Default value:** ``conda-forge``. @@ -107,8 +107,8 @@ are explained below. conda-forge ~~~~~~~~~~~ -This option looks for dependencies first in the ``conda-forge`` channel, -then the default ``anaconda`` channel, before falling back to ``pip``. +This option looks for dependencies in the ``conda-forge`` channel, +before falling back to ``pip``. .. note:: @@ -116,18 +116,9 @@ then the default ``anaconda`` channel, before falling back to ``pip``. ``conda`` is a great package manager for creating isolated environments, and managing dependencies between them. Moreover, many packages are available on ``conda-forge`` - that are not on the default ``anaconda`` channel or ``pip``. + that are not on ``pip``. - -anaconda -~~~~~~~~ - -This option still uses ``conda`` to manage dependencies, -but only uses the ``anaconda`` channel and ``pip`` fallback. -This option would install MDAnalysis from `PyPI`_ . -as it is not available on the default ``anaconda`` channel. - pip ~~~ diff --git a/tests/utils.py b/tests/utils.py index 58f34cb9..ca71477d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,8 +25,7 @@ def get_classes_from_file(path: str) -> List: class DependencyType(enum.Enum): - CONDAFORGE = "Prefer conda-forge over the default anaconda channel with pip fallback" - ANACONDA = "Prefer default anaconda channel with pip fallback" + CONDAFORGE = "Prefer conda-forge with pip fallback" PIP = "Dependencies from pip only (no conda)" diff --git a/{{cookiecutter.repo_name}}/.github/workflows/{{cookiecutter._ci_name}}.yaml b/{{cookiecutter.repo_name}}/.github/workflows/{{cookiecutter._ci_name}}.yaml index 79dd57f0..3631096e 100644 --- a/{{cookiecutter.repo_name}}/.github/workflows/{{cookiecutter._ci_name}}.yaml +++ b/{{cookiecutter.repo_name}}/.github/workflows/{{cookiecutter._ci_name}}.yaml @@ -68,9 +68,7 @@ jobs: {% if cookiecutter.__dependency_source == 'conda-forge' %} miniforge-variant: Mambaforge use-mamba: true - channels: conda-forge, defaults -{% elif cookiecutter.__dependency_source == 'anaconda' %} - channels: defaults + channels: conda-forge {% endif %} activate-environment: {{cookiecutter.repo_name}}-test auto-update-conda: true diff --git a/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml b/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml index c739e5ac..85b46b45 100644 --- a/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml +++ b/{{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml @@ -1,7 +1,6 @@ name: {{cookiecutter.repo_name}}-test -channels:{% if cookiecutter.__dependency_source == 'anaconda' %} - - defaults -{% elif cookiecutter.__dependency_source == 'conda-forge' %} +channels: +{% if cookiecutter.__dependency_source == 'conda-forge' %} - conda-forge {% endif %} dependencies: @@ -16,14 +15,8 @@ dependencies: - pytest - pytest-cov - pytest-xdist -{% if cookiecutter.__dependency_source == 'anaconda' %} - # Pip-only installs - - pip: - - codecov - - MDAnalysis -{% else %} - codecov + - codecov # Pip-only installs #- pip: # - codecov -{% endif %} diff --git a/{{cookiecutter.repo_name}}/docs/README.md b/{{cookiecutter.repo_name}}/docs/README.md index f30cb4b0..4908cf10 100644 --- a/{{cookiecutter.repo_name}}/docs/README.md +++ b/{{cookiecutter.repo_name}}/docs/README.md @@ -3,9 +3,9 @@ The docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/master/). To compile the docs, first ensure that Sphinx and the ReadTheDocs theme are installed. -{% if (cookiecutter.dependency_source == 'Prefer conda-forge over the default anaconda channel with pip fallback' or cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback') %} +{% if cookiecutter.dependency_source == 'Prefer conda-forge with pip fallback' %} ```bash -conda install sphinx sphinx_rtd_theme +conda install sphinx sphinx_rtd_theme ``` {% elif cookiecutter.dependency_source == 'Dependencies from pip only (no conda)' %} ```bash diff --git a/{{cookiecutter.repo_name}}/docs/requirements.yaml b/{{cookiecutter.repo_name}}/docs/requirements.yaml index eb35feef..a8c83a0a 100644 --- a/{{cookiecutter.repo_name}}/docs/requirements.yaml +++ b/{{cookiecutter.repo_name}}/docs/requirements.yaml @@ -1,10 +1,6 @@ name: {{cookiecutter.repo_name}}-docs channels: -{% if cookiecutter.__dependency_source == 'anaconda' %} - - defaults -{% else %} - conda-forge -{% endif %} dependencies: # Base depends - python From 3180dba03f13d8ac4138add25cb743e6d6d1da80 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Mon, 1 Jun 2026 21:19:02 +1000 Subject: [PATCH 4/5] update --- docs/source/getting_started.rst | 19 +++++-------------- mdakitter | 5 ++--- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 1e8ae736..fe937b4e 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -146,8 +146,8 @@ dependency_source This option determines which sources to use for dependencies for the package. It affects the continuous integration testing, as well as -the dependency files written. The three choices -(``conda-forge``, ``anaconda``, and ``pip``) +the dependency files written. The two choices +(``conda-forge`` and ``pip``) are explained below. **Default value:** ``conda-forge``. @@ -156,8 +156,8 @@ are explained below. conda-forge ~~~~~~~~~~~ -This option looks for dependencies first in the ``conda-forge`` channel, -then the default ``anaconda`` channel, before falling back to ``pip``. +This option looks for dependencies in the ``conda-forge`` channel, +before falling back to ``pip``. .. note:: @@ -165,18 +165,9 @@ then the default ``anaconda`` channel, before falling back to ``pip``. ``conda`` is a great package manager for creating isolated environments, and managing dependencies between them. Moreover, many packages are available on ``conda-forge`` - that are not on the default ``anaconda`` channel or ``pip``. + that are not available on ``pip``. - -anaconda -~~~~~~~~ - -This option still uses ``conda`` to manage dependencies, -but only uses the ``anaconda`` channel and ``pip`` fallback. -This option would install MDAnalysis from `PyPI`_ . -as it is not available on the default ``anaconda`` channel. - pip ~~~ diff --git a/mdakitter b/mdakitter index a1fb0345..138f89bc 100755 --- a/mdakitter +++ b/mdakitter @@ -57,11 +57,10 @@ parser.add_argument( ) parser.add_argument( "--dependency-source", - choices=["conda-forge", "anaconda", "pip"], + choices=["conda-forge", "pip"], help=( "Source to choose for dependencies. " - "'conda-forge' prefers conda-forge over the default anaconda channel with pip fallback. " - "'anaconda' prefers default anaconda channel with pip fallback. " + "'conda-forge' prefers the conda-forge channel with pip fallback. " "'pip' uses dependencies from pip only (no conda)" ), default="conda-forge", From 8959ef4ee86f5a4a85ce85bb9db8e5d44609b796 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 2 Jun 2026 05:35:18 +1000 Subject: [PATCH 5/5] fix docs --- docs/scripts/generate_cookiecutter_cli.py | 2 +- docs/scripts/parse_authors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scripts/generate_cookiecutter_cli.py b/docs/scripts/generate_cookiecutter_cli.py index 7ba72c2e..1abac41c 100755 --- a/docs/scripts/generate_cookiecutter_cli.py +++ b/docs/scripts/generate_cookiecutter_cli.py @@ -100,7 +100,7 @@ def generate_cli_output(self) -> str: "my-github-username", # github_host_account "My Name", # author_name "my_example_email@gmail.com", # author_email - "3", # dependency_source + "2", # dependency_source "1", # include_ReadTheDocs "MyAnalysisClass", # template_analysis_class "1", # license diff --git a/docs/scripts/parse_authors.py b/docs/scripts/parse_authors.py index a65ee889..1d89a500 100644 --- a/docs/scripts/parse_authors.py +++ b/docs/scripts/parse_authors.py @@ -7,7 +7,7 @@ def parse_authors(sort_alphabetically: bool = False): - username_pattern = "<@[\S]+>" + username_pattern = r"<@[\S]+>" with AUTHOR_FILE.open("r") as f: contents = [x.strip() for x in f.readlines()]