Skip to content

Commit

Permalink
new formatting and template
Browse files Browse the repository at this point in the history
  • Loading branch information
selmanozleyen committed Apr 24, 2024
1 parent 389807e commit 675dcc3
Show file tree
Hide file tree
Showing 36 changed files with 371 additions and 775 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Sync Template

on:
workflow_dispatch:
workflow_dispatch:

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/[email protected]
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.
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/[email protected]
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.**
**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).
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).
113 changes: 33 additions & 80 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,85 +1,38 @@
fail_fast: false
default_language_version:
python: python3
python: python3
default_stages:
- commit
- push
- commit
- push
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier
# Newer versions of node don't work on systems that have an older version of GLIBC
# (in particular Ubuntu 18.04 and Centos 7)
# EOL of Centos 7 is in 2024-06, we can probably get rid of this then.
# See https://github.com/scverse/cookiecutter-scverse/issues/143 and
# https://github.com/jupyterlab/jupyterlab/issues/12675
language_version: "17.9.1"
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies:
- flake8-tidy-imports
- flake8-docstrings
- flake8-rst-docstrings
- flake8-comprehensions
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variable
- --ignore-init-module-imports
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-tidy-imports
- flake8-docstrings
- flake8-rst-docstrings
- flake8-comprehensions
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
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$'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: check-case-conflict
# Check that there are no merge conflicts (could be generated by template sync)
- id: check-merge-conflict
args: [--assume-in-merge]
- 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$'
89 changes: 0 additions & 89 deletions .pre-commit-config.yaml.rej

This file was deleted.

22 changes: 11 additions & 11 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
os: ubuntu-20.04
tools:
python: "3.10"
sphinx:
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: false
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: false
python:
install:
- method: pip
path: .
extra_requirements:
- doc
install:
- method: pip
path: .
extra_requirements:
- doc
29 changes: 0 additions & 29 deletions .readthedocs.yaml.rej

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ See the [changelog][changelog].
For questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].
If you found a bug, please use the [issue tracker][issue-tracker].


## Credits

Some of the data for `DatasetHartmann` is distributed in this package.
Expand Down
10 changes: 0 additions & 10 deletions README.md.rej

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
.. automodule:: geome.datamodule
:members:
```
```
Loading

0 comments on commit 675dcc3

Please sign in to comment.