Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update instance repo (PR 109) #22

Merged
merged 2 commits into from
Oct 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ rst-roles =
class,
func,
ref,
cite:p,
cite:t,
rst-directives =
envvar,
exception,
Expand Down
89 changes: 89 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Bug report
description: Report something that is broken or incorrect
labels: bug
body:
- type: markdown
attributes:
value: |
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
detailing how to provide the necessary information for us to reproduce your bug. In brief:
* Please provide exact steps how to reproduce the bug in a clean Python environment.
* In case it's not clear what's causing this bug, please provide the data or the data generation procecure.
* Sometimes it is not possible to share the data but usually it is possible to replicate problems on publicly
available datasets or to share a subset of your data.
- type: textarea
id: report
attributes:
label: Report
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: versions
attributes:
label: Version information
description: |
Please paste below the output of
```python
import session_info
session_info.show(html=False, dependencies=True)
```
placeholder: |
-----
anndata 0.8.0rc2.dev27+ge524389
session_info 1.0.0
-----
asttokens NA
awkward 1.8.0
backcall 0.2.0
cython_runtime NA
dateutil 2.8.2
debugpy 1.6.0
decorator 5.1.1
entrypoints 0.4
executing 0.8.3
h5py 3.7.0
ipykernel 6.15.0
jedi 0.18.1
mpl_toolkits NA
natsort 8.1.0
numpy 1.22.4
packaging 21.3
pandas 1.4.2
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pkg_resources NA
prompt_toolkit 3.0.29
psutil 5.9.1
ptyprocess 0.7.0
pure_eval 0.2.2
pydev_ipython NA
pydevconsole NA
pydevd 2.8.0
pydevd_file_utils NA
pydevd_plugins NA
pydevd_tracing NA
pygments 2.12.0
pytz 2022.1
scipy 1.8.1
setuptools 62.5.0
setuptools_scm NA
six 1.16.0
stack_data 0.3.0
tornado 6.1
traitlets 5.3.0
wcwidth 0.2.5
zmq 23.1.0
-----
IPython 8.4.0
jupyter_client 7.3.4
jupyter_core 4.10.0
-----
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
Linux-5.18.6-arch1-1-x86_64-with-glibc2.35
-----
Session information updated at 2022-07-07 17:55
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Scverse Community Forum
url: https://discourse.scverse.org/
about: If you have questions about “How to do X”, please ask them here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Feature request
description: Propose a new feature for cookiecutter-scverse-instance
labels: enhancement
body:
- type: textarea
id: description
attributes:
label: Description of feature
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
validations:
required: true
46 changes: 46 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Sync Template

on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # every night at 2:00 UTC

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
# for now, pin cookiecutter version, due to https://github.com/cruft/cruft/issues/166
run: python -m pip install --upgrade cruft "cookiecutter<2" pre-commit toml
- name: Find Latest Tag
uses: oprypin/find-latest-tag@v1.1.0
id: get-latest-tag
with:
repository: scverse/cookiecutter-scverse
releases-only: false
sort-tags: true
regex: '^v\d+\.\d+\.\d+$' # vX.X.X
- name: Sync
run: |
cruft update --checkout ${{ steps.get-latest-tag.outputs.tag }} --skip-apply-ask --project-dir .
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Automated template update from cookiecutter-scverse
branch: template-update
title: Automated template update from cookiecutter-scverse
body: |
A new version of the [scverse cookiecutter template](https://github.com/scverse/cookiecutter-scverse/releases)
got released. This PR adds all new changes to your repository and helps to to stay in sync with
the latest best-practice template maintained by the scverse team.

**If a merge conflict arised, a `.rej` file with the rejected patch is generated. You'll need to
manually merge these changes.**

For more information about the template sync, please refer to the
[template documentation](https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#automated-template-sync).
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.1
rev: v3.0.0-alpha.2
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/myint/autoflake
rev: v1.7.1
rev: v1.7.6
hooks:
- id: autoflake
args:
Expand All @@ -64,7 +64,16 @@ repos:
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/asottile/pyupgrade
rev: v3.0.0
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py3-plus, --py38-plus, --keep-runtime-typing]
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit rej files
entry: |
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
Fix the merge conflicts manually and remove the .rej files.
language: fail
files: '.*\.rej$'
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build:
python: "3.10"
sphinx:
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: true
python:
install:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Please refer to the [documentation][link-docs]. In particular, the
## Installation

You need to have Python 3.8 or newer installed on your system. If you don't have
Python installed, we recommend installing [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
Python installed, we recommend installing [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge).

There are several alternative options to install cookiecutter-scverse-instance:

Expand Down
65 changes: 65 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. add toctree option to make autodoc generate the pages
.. autoclass:: {{ objname }}

{% block attributes %}
{% if attributes %}
Attributes table
~~~~~~~~~~~~~~~~~~

.. autosummary::
{% for item in attributes %}
~{{ fullname }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block methods %}
{% if methods %}
Methods table
~~~~~~~~~~~~~

.. autosummary::
{% for item in methods %}
{%- if item != '__init__' %}
~{{ fullname }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes_documentation %}
{% if attributes %}
Attributes
~~~~~~~~~~~

{% for item in attributes %}
{{ item }}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autoattribute:: {{ [objname, item] | join(".") }}
{%- endfor %}

{% endif %}
{% endblock %}

{% block methods_documentation %}
{% if methods %}
Methods
~~~~~~~

{% for item in methods %}
{%- if item != '__init__' %}
{{ item }}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: {{ [objname, item] | join(".") }}
{%- endif -%}
{%- endfor %}

{% endif %}
{% endblock %}
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
:toctree: generated

pl.basic_plot
pl.BasicClass
```
40 changes: 32 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
# -- Project information -----------------------------------------------------

info = metadata("cookiecutter-scverse-instance")
project = info["Name"]
project_name = info["Name"]
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
repository_url = "https://github.com/" + "scverse" + "/" + project_name

# The full version, including alpha/beta/rc tags
release = info["Version"]
Expand All @@ -33,7 +34,7 @@
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "scverse", # Username
"github_repo": project, # Repo name
"github_repo": project_name, # Repo name
"github_version": "main", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
Expand All @@ -43,15 +44,14 @@
# Add any Sphinx extension module names here, as strings.
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"myst_parser",
"myst_nb",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinxcontrib.bibtex",
"sphinx_autodoc_typehints",
"scanpydoc.definition_list_typed_field",
"nbsphinx",
"sphinx.ext.mathjax",
*[p.stem for p in (HERE / "extensions").glob("*.py")],
]
Expand All @@ -65,13 +65,31 @@
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True
myst_heading_anchors = 3 # create anchors for h1-h3
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
"html_admonition",
]
myst_url_schemes = ("http", "https", "mailto")
nb_output_stderr = "remove"
nb_execution_mode = "off"
nb_merge_streams = True
typehints_defaults = "braces"

source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".myst": "myst-nb",
}

intersphinx_mapping = {
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}

nbsphinx_execute = "never"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -84,10 +102,16 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_title = project_name

html_theme_options = {
"repository_url": repository_url,
"use_repository_button": True,
}

pygments_style = "sphinx"
pygments_style = "default"

nitpick_ignore = [
# If building the documentation fails because of a missing link that is outside your control,
Expand Down