Skip to content

Commit

Permalink
Merge branch 'release/0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
piskunow committed Nov 23, 2023
2 parents e55640e + 7b73af1 commit c289cf0
Show file tree
Hide file tree
Showing 27 changed files with 7,428 additions and 1,063 deletions.
2 changes: 1 addition & 1 deletion .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "[email protected]",
"friendly_name": "KPM Tools",
"github_user": "piskunow",
"license": "MIT",
"license": "BSD 2-Clause",
"package_name": "kpm_tools",
"project_name": "kpm-tools",
"version": "0.0.0"
Expand Down
1 change: 1 addition & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[darglint]
strictness = long
ignore=DAR101
3 changes: 1 addition & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503
ignore = E203,E501,RST201,RST203,RST301,W503,C901
max-line-length = 80
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101
rst-roles = class,const,func,meth,mod,ref
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==22.1.2
nox==2022.1.7
nox-poetry==1.0.0
poetry==1.1.13
virtualenv==20.14.1
pip==23.3.1
nox==2023.4.22
nox-poetry==1.0.3
poetry==1.7.1
virtualenv==20.24.7
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4.0.0
uses: crazy-max/ghaction-github-labeler@v5.0.0
with:
skip-delete: true
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -39,7 +39,7 @@ jobs:
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/[email protected].1
uses: salsify/[email protected].3
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
Expand All @@ -57,21 +57,21 @@ jobs:
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/release-drafter@v5.20.0
uses: release-drafter/release-drafter@v5.25.0
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Tests

on:
- push
- pull_request

jobs:
Expand All @@ -14,16 +13,8 @@ jobs:
include:
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.10", os: "ubuntu-latest", session: "safety" }
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
- { python: "3.8", os: "ubuntu-latest", session: "mypy" }
- { python: "3.7", os: "ubuntu-latest", session: "mypy" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.8", os: "ubuntu-latest", session: "tests" }
- { python: "3.7", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "windows-latest", session: "tests" }
- { python: "3.10", os: "macos-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
Expand All @@ -35,7 +26,7 @@ jobs:

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
Expand All @@ -47,20 +38,29 @@ jobs:
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Install System Dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && (matrix.session 'tests' | matrix.session == 'pre-commit')
run: |
sudo apt-get update
sudo apt-get install -y python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ build-essential gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
- name: Install Python dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && (matrix.session 'tests' | matrix.session == 'pre-commit')
run: |
python -m pip install cython tinyarray
- name: Clone and Install kwant (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && (matrix.session 'tests' | matrix.session == 'pre-commit')
run: |
git clone https://github.com/kwant-project/kwant.git
cd kwant
git checkout master
- name: Install Nox
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
Expand Down Expand Up @@ -91,6 +91,11 @@ jobs:
restore-keys: |
${{ steps.pre-commit-cache.outputs.result }}-
# Add this step to install Pandoc
- name: Install pandoc
if: matrix.session == 'docs-build'
run: sudo apt-get install pandoc

- name: Run Nox
run: |
nox --python=${{ matrix.python }}
Expand All @@ -114,7 +119,7 @@ jobs:
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
Expand Down Expand Up @@ -151,4 +156,4 @@ jobs:
nox --session=coverage -- xml
- name: Upload coverage report
uses: codecov/[email protected].0
uses: codecov/[email protected].4
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ repos:
language: system
types: [text]
stages: [commit, push, manual]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here is a list of important resources for contributors:
- [Issue Tracker]
- [Code of Conduct]

[BSD 2-Clause license]: https://opensource.org/license/bsd-2-clause/
[bsd 2-clause license]: https://opensource.org/license/bsd-2-clause/
[source code]: https://github.com/piskunow/kpm-tools
[documentation]: https://kpm-tools.readthedocs.io/
[issue tracker]: https://github.com/piskunow/kpm-tools/issues
Expand All @@ -37,7 +37,7 @@ Request features on the [Issue Tracker].

## How to set up your development environment

You need Python 3.7+ and the following tools:
You need Python 3.9+ and the following tools:

- [Poetry]
- [Nox]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<<<<<<< HEAD
# kpm-tools

=======

# KPM Tools

[![PyPI](https://img.shields.io/pypi/v/kpm-tools.svg)][pypi_]
Expand Down Expand Up @@ -51,7 +52,7 @@ To learn more, see the [Contributor Guide].

## License

Distributed under the terms of the [MIT license][license],
Distributed under the terms of the [BSD 2-Clause license][license],
_KPM Tools_ is free and open source software.

## Issues
Expand All @@ -74,4 +75,3 @@ This project was generated from [@cjolowicz]'s [Hypermodern Python Cookiecutter]
[license]: https://github.com/piskunow/kpm-tools/blob/main/LICENSE
[contributor guide]: https://github.com/piskunow/kpm-tools/blob/main/CONTRIBUTING.md
[command-line reference]: https://kpm-tools.readthedocs.io/en/latest/usage.html
>>>>>>> dccb53a (initial commit from hypermodern template)
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coverage:
status:
project:
default:
target: "100"
target: "0"
patch:
default:
target: "100"
target: "0"
26 changes: 26 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@
"sphinx.ext.napoleon",
"sphinx_click",
"myst_parser",
"nbsphinx",
]
nbsphinx_allow_errors = True
autodoc_typehints = "description"
html_theme = "furo"
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
nbsphinx_prolog = r"""
.. raw:: html
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Run this Jupyter Notebook locally:
<a id="downloadNotebookLink" href="javascript:void(0);" class="download-notebook-button" target="_blank" download>
Download Notebook
</a>
</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var currentPath = window.location.pathname;
var notebookName = currentPath.split('/').pop().replace('.html', '.ipynb');
var downloadLink = "{{ readthedocs_download_url | e }}" + notebookName;
document.getElementById('downloadNotebookLink').href = downloadLink;
});
</script>
""" # noqa: B950
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ hidden:
maxdepth: 1
---
Tutorials <tutorials>
usage
reference
contributing
Expand Down
10 changes: 6 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
furo==2022.4.7
sphinx==4.5.0
sphinx-click==4.1.0
myst_parser==0.17.2
furo==2023.9.10
sphinx==7.2.6
sphinx-click==5.1.0
myst_parser==2.0.0
nbsphinx==0.9.3
pandoc==2.3
9 changes: 9 additions & 0 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 📘 Tutorials

```{toctree}
---
maxdepth: 1
---
tutorials/tutorial_bloch
```
Loading

0 comments on commit c289cf0

Please sign in to comment.