Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -40,8 +39,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] }}",
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/generate_cookiecutter_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/parse_authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]

Expand Down
6 changes: 2 additions & 4 deletions docs/source/cookiecutter/json_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
19 changes: 5 additions & 14 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand All @@ -156,27 +156,18 @@ 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::

We **highly recommend** using ``conda-forge``.
``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
~~~

Expand Down
5 changes: 2 additions & 3 deletions mdakitter
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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)"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ jobs:
miniforge-version: "latest"
use-mamba: true
channels: conda-forge
{% elif cookiecutter.__dependency_source == 'anaconda' %}
miniconda-version: "latest"
channels: defaults
{% endif %}
activate-environment: {{cookiecutter.repo_name}}-test
auto-update-conda: true
Expand Down
17 changes: 6 additions & 11 deletions {{cookiecutter.repo_name}}/devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: {{cookiecutter.repo_name}}-test
channels:{% if cookiecutter.dependency_source == 'Prefer conda-forge over the default anaconda channel with pip fallback' %}
- conda-forge{% endif %}
- defaults
channels:
{% if 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 %}
# Testing
- pytest
- pytest-cov
- pytest-xdist
{% if cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback' %}
# Pip-only installs
- pip:
- codecov
- MDAnalysis
{% else %} - codecov
- codecov

# Pip-only installs
#- pip:
# - codecov
{% endif %}
4 changes: 2 additions & 2 deletions {{cookiecutter.repo_name}}/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions {{cookiecutter.repo_name}}/docs/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: {{cookiecutter.repo_name}}-docs
channels:
{% if cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback' %}
- defaults
{% else %}
- conda-forge
{% endif %}
dependencies:
# Base depends
- python
Expand Down
Loading