Skip to content
Open
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
5 changes: 2 additions & 3 deletions .github/workflows/conda_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:
push:
branches: ["master"]

permissions:
contents: read

jobs:
tests:
name: "Conda"
permissions:
contents: read
runs-on: ubuntu-22.04
defaults:
run:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docs_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
docs:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
name: "Flake8"
permissions:
contents: read
runs-on: "ubuntu-22.04"

steps:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
permissions:
contents: read
name: "mypy / ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/octocheese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ on:
schedule:
- cron: 0 12 * * *

permissions:
contents: write

jobs:
Run:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: domdfcoding/octocheese@master
with:
pypi_name: "mh_utils"
pypi_name: "mh-utils"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: startsWith(github.ref, 'refs/tags/') != true
8 changes: 3 additions & 5 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "windows-2022 / Python ${{ matrix.config.python-version }}"
runs-on: "windows-2022"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ on:
- '*'
pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}"
runs-on: "ubuntu-22.04"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down Expand Up @@ -82,6 +80,9 @@ jobs:

Coverage:
needs: tests
permissions:
actions: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -131,7 +132,10 @@ jobs:

Deploy:
needs: tests

permissions:
actions: write
issues: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -162,7 +166,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
skip-existing: true

- name: Close milestone 🚪
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -176,6 +180,8 @@ jobs:

Conda:
needs: deploy
permissions:
contents: read
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true)
steps:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}"
runs-on: "macos-${{ matrix.config.os-ver }}"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ docs/_build/
doc/build
target/
.ipynb_checkpoints
.python-version
celerybeat-schedule
celerybeat.pid
*.sage.py
Expand Down
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/repo-helper/pyproject-parser
rev: v0.13.0
rev: v0.14.0
hooks:
- id: reformat-pyproject

Expand All @@ -18,7 +18,6 @@ repos:
- id: check-added-large-files
- id: check-ast
- id: fix-byte-order-marker
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
Expand All @@ -33,7 +32,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/domdfcoding/pre-commit-hooks
rev: v0.4.0
rev: v0.5.0
hooks:
- id: requirements-txt-sorter
args:
Expand Down Expand Up @@ -81,13 +80,15 @@ repos:
- id: snippet-fmt

- repo: https://github.com/python-formate/formate
rev: v0.8.0
rev: v1.1.2
hooks:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
additional_dependencies:
- formate-trailing-commas>=0.1.1

- repo: https://github.com/python-coincidence/dep_checker
rev: v0.8.0
rev: v0.9.0
hooks:
- id: dep_checker
args:
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ split_before_dict_set_generator=True
#
# foo = ('This is a really long string: {}, {}, {}, {}'
# .format(a, b, c, d))
split_before_dot=False
split_before_dot=True

# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
Expand Down
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ mh_utils
:target: https://www.codefactor.io/repository/github/PyMassSpec/mh_utils
:alt: CodeFactor Grade

.. |pypi-version| image:: https://img.shields.io/pypi/v/mh_utils
:target: https://pypi.org/project/mh_utils/
.. |pypi-version| image:: https://img.shields.io/pypi/v/mh-utils
:target: https://pypi.org/project/mh-utils/
:alt: PyPI - Package Version

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/mh_utils?logo=python&logoColor=white
:target: https://pypi.org/project/mh_utils/
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/mh-utils?logo=python&logoColor=white
:target: https://pypi.org/project/mh-utils/
:alt: PyPI - Supported Python Versions

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/mh_utils
:target: https://pypi.org/project/mh_utils/
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/mh-utils
:target: https://pypi.org/project/mh-utils/
:alt: PyPI - Supported Implementations

.. |wheel| image:: https://img.shields.io/pypi/wheel/mh_utils
:target: https://pypi.org/project/mh_utils/
.. |wheel| image:: https://img.shields.io/pypi/wheel/mh-utils
:target: https://pypi.org/project/mh-utils/
:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/mh_utils?logo=anaconda
Expand All @@ -109,11 +109,11 @@ mh_utils
:target: https://github.com/PyMassSpec/mh_utils/commit/master
:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2025
.. |maintained| image:: https://img.shields.io/maintenance/yes/2026
:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/mh_utils
:target: https://pypi.org/project/mh_utils/
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/mh-utils
:target: https://pypistats.org/packages/mh-utils
:alt: PyPI - Downloads

.. end shields
Expand All @@ -131,7 +131,7 @@ To install with ``pip``:

.. code-block:: bash

$ python -m pip install mh_utils
$ python -m pip install mh-utils

To install with ``conda``:

Expand Down
13 changes: 7 additions & 6 deletions doc-source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ mh_utils
:alt: CodeFactor Grade

.. |pypi-version| pypi-shield::
:project: mh_utils
:project: mh-utils
:version:
:alt: PyPI - Package Version

.. |supported-versions| pypi-shield::
:project: mh_utils
:project: mh-utils
:py-versions:
:alt: PyPI - Supported Python Versions

.. |supported-implementations| pypi-shield::
:project: mh_utils
:project: mh-utils
:implementations:
:alt: PyPI - Supported Implementations

.. |wheel| pypi-shield::
:project: mh_utils
:project: mh-utils
:wheel:
:alt: PyPI - Wheel

Expand Down Expand Up @@ -114,11 +114,11 @@ mh_utils
:last-commit:
:alt: GitHub last commit

.. |maintained| maintained-shield:: 2025
.. |maintained| maintained-shield:: 2026
:alt: Maintenance

.. |pypi-downloads| pypi-shield::
:project: mh_utils
:project: mh-utils
:downloads: month
:alt: PyPI - Downloads

Expand All @@ -140,6 +140,7 @@ Installation

.. installation:: mh_utils
:pypi:
:pypi-name: mh-utils
:github:
:anaconda:
:conda-channels: conda-forge, domdfcoding
Expand Down
2 changes: 1 addition & 1 deletion doc-source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ License
.. license-info:: MIT

.. license::
:py: mh_utils
:py: mh-utils
37 changes: 7 additions & 30 deletions formate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70
squish_stubs = 80
newline_after_equals = 90

[hooks.yapf]
priority = 30

[hooks.yapf.kwargs]
yapf_style = ".style.yapf"

[hooks.trailing_commas]
priority = 21

[hooks.trailing_commas.kwargs]
format_ImportFrom = false

[hooks.isort]
priority = 50

Expand All @@ -27,36 +34,6 @@ lines_between_types = 0
use_parentheses = true
remove_redundant_aliases = true
default_section = "THIRDPARTY"
known_third_party = [
"attr",
"attr_utils",
"attrs",
"backports_entry_points_selectable",
"betamax",
"cawdrey",
"chemistry_tools",
"coincidence",
"coverage",
"coverage_pyver_pragma",
"domdf_python_tools",
"enum_tools",
"github",
"importlib_metadata",
"importlib_resources",
"lxml",
"mathematical",
"numpy",
"pandas",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_regressions",
"pytest_rerunfailures",
"pytest_timeout",
"requests",
"sdjson",
"typing_extensions",
]
known_first_party = [ "mh_utils",]

[config]
Expand Down
Loading
Loading