Skip to content

Commit

Permalink
Merge pull request #684 from hakonanes/hatch-n-pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonanes authored Sep 22, 2024
2 parents e5fad49 + c49fbac commit 361f546
Show file tree
Hide file tree
Showing 30 changed files with 461 additions and 645 deletions.
121 changes: 0 additions & 121 deletions .all-contributorsrc

This file was deleted.

3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
- [ ] New functions are imported in corresponding `__init__.py`.
- [ ] New features, API changes, and deprecations are mentioned in the unreleased
section in `CHANGELOG.rst`.
- [ ] New contributors are added to `release.py`, `.zenodo.json` and
`.all-contributorsrc` with the table regenerated.
- [ ] New contributors are added to `kikuchipy/__init__.py` and `.zenodo.json`.
4 changes: 2 additions & 2 deletions .github/workflows/perhaps_make_tagged_release_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

from outdated import check_outdated

with open("../../kikuchipy/release.py") as fid:
with open("../../kikuchipy/__init__.py") as fid:
for line in fid:
if line.startswith("version"):
if line.startswith("__version__"):
branch_version = line.strip().split(" = ")[-1][1:-1]

# Within a try/except because we don't want to throw the error if a new
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/perhaps_make_tagged_release_draft.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
name: Perhaps make a tagged release

# Trigger workflow when commits to the main branch contain a change in the
# kikuchipy/release.py file. This is because this workflow should only run when a
# tagged release draft is to be made.
# Trigger workflow when commits to the main branch contain a change in
# the kikuchipy/__init__.py file. This is because this workflow should
# only run when a tagged release draft is to be made.
on:
push:
branches:
- main
paths:
- "kikuchipy/release.py"
- "kikuchipy/__init__.py"

jobs:
make-tagged-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- name: Set up Python ${{ runner.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install outdated
python -m pip install -U pip
python -m pip install outdated
- name: Check whether a tagged release draft should be made
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
release:
types: [published]
workflow_dispatch:
workflow: "*"

jobs:
upload:
Expand All @@ -24,17 +23,17 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
python -m pip install -U pip
python -m pip install build
- name: Build package
run: |
Expand All @@ -44,7 +43,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 2 additions & 3 deletions .github/workflows/test_documentation_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
schedule:
- cron: '15 6 * * 1'
workflow_dispatch:
workflow: "*"

env:
MPLBACKEND: agg
Expand All @@ -14,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- uses: isort/isort-action@master
with:
Expand All @@ -34,25 +34,6 @@ jobs:
run: |
black --diff --line-length 77 doc/tutorials/*.ipynb
# Make sure all necessary files are included in a release
manifest:
name: check manifest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install manifix
- name: Check MANIFEST.in file
run: |
python setup.py manifix
tests:
name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}
Expand All @@ -64,14 +45,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11']
python-version: ['3.11', '3.12']
include:
- os: ubuntu-latest
python-version: 3.8
DEPENDENCIES: dask==2021.8.1 diffsims==0.5.2 hyperspy==1.7.3 matplotlib==3.5 numba==0.57 numpy==1.23.0 orix==0.12.1 pooch==1.3.0 pyebsdindex==0.2.0 scikit-image==0.21.0
LABEL: -oldest
- os: ubuntu-latest
python-version: 3.11
python-version: 3.12
LABEL: -minimum_requirement
steps:
- uses: actions/checkout@v4
Expand All @@ -85,7 +66,7 @@ jobs:
shell: bash
run: |
pip install wheel
pip install -U -e .'[tests]'
pip install -U -e ".[tests,coverage]"
- name: Install oldest supported version
if: contains(matrix.LABEL, 'oldest')
Expand All @@ -96,15 +77,15 @@ jobs:
if: ${{ contains(matrix.LABEL, 'minimum_requirement') == false && matrix.os != 'macos-latest' }}
shell: bash
run: |
pip install -e .'[all]'
pip install -e ".[all]"
pip install pyopencl
- name: Install optional dependencies on macOS (without nlopt)
if: ${{ contains(matrix.LABEL, 'minimum_requirement') == false && matrix.os == 'macos-latest' }}
shell: bash
run: |
pip install -e .
pip install 'pyebsdindex[gpu]' pyvista
pip install "pyebsdindex[gpu]" pyvista
- name: Display Python, pip and package versions
run: |
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,5 @@ src/
# Backport
.backportrc.json

# All Contributors CLI
node_modules/
package.json
package-lock.json

# Dask
dask-worker-space
2 changes: 0 additions & 2 deletions CONTRIBUTING.rst

This file was deleted.

13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 361f546

Please sign in to comment.