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

Add linters and clean up #14

Merged
merged 24 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c3bf716
add pre-commit config file
mcflugen Feb 15, 2024
784e61e
rename test files to have _test suffix; move outside of package
mcflugen Feb 15, 2024
70f7ab6
remove conda recipe folder
mcflugen Feb 15, 2024
0067d48
clean up the gitignore file
mcflugen Feb 15, 2024
6fc24ad
remove lint
mcflugen Feb 15, 2024
e69f865
clean up dependencies
mcflugen Feb 15, 2024
76e3732
add a version file
mcflugen Feb 15, 2024
09e4e5b
clean up the pyproject.toml file
mcflugen Feb 15, 2024
dea8cd9
no relative imports
mcflugen Feb 15, 2024
b203e5a
add a noxfile
mcflugen Feb 15, 2024
ff5ceb5
use nox for runing the tests
mcflugen Feb 15, 2024
8b46ef1
remove format and lint workflows, we'll use pre-commit.ci
mcflugen Feb 15, 2024
1ae4901
remove the makefile
mcflugen Feb 15, 2024
6cc07af
remove version from pyproject.toml
mcflugen Feb 15, 2024
450a9bb
fix dynamic version section
mcflugen Feb 15, 2024
44d8e7c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 15, 2024
ae8e0b9
Merge branch 'mcflugen/add-linters' of github.com:csdms/standard_name…
mcflugen Feb 15, 2024
1de2fca
remove call to non-existant build_generated_docs
mcflugen Feb 15, 2024
5d183de
switch to a src-layout; remove manifest
mcflugen Feb 16, 2024
215ba0b
add annotations
mcflugen Feb 16, 2024
f105201
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 16, 2024
cb1f861
simplify the init method of the NamesRegistry
mcflugen Feb 17, 2024
5f8b9d1
add more annotations, add more mypy checks
mcflugen Feb 17, 2024
fccf93b
Merge branch 'mcflugen/add-linters' of github.com:csdms/standard_name…
mcflugen Feb 17, 2024
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
21 changes: 0 additions & 21 deletions .github/workflows/format.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/lint.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -32,8 +32,7 @@ jobs:

- name: Install package and testing dependencies
run: |
pip install .[test]
pip install .[dev,test]

- name: Test
run: |
make test
run: nox -s test
39 changes: 5 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
*.egg-info/
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
.nox/
__pycache__/
build/
dist/
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
args: [--max-line-length=88]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py310-plus]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--force-single-line-imports]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace
- id: name-tests-test
- id: file-contents-sorter
files: |
(?x)^(
.*requirements(-\w+)?.(in|txt)|
requirements/.*\.txt|
.gitignore
)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
language_version: python3.12
additional_dependencies: [types-all]
files: standard_names/.*\.py$
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

93 changes: 0 additions & 93 deletions Makefile

This file was deleted.

49 changes: 0 additions & 49 deletions conda-recipe/meta.yaml

This file was deleted.

20 changes: 9 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# standard_names documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 22 11:31:51 2016.
Expand All @@ -12,9 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex
import sys

sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
Expand Down Expand Up @@ -217,14 +215,14 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Loading
Loading