Skip to content

Commit

Permalink
feat: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Dec 22, 2023
1 parent db9e892 commit 8147230
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 80 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg', 'requirements-dev.txt') }}
restore-keys: ${{ runner.os }}-pip-
cache: pip
- name: Install package and dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r requirements-dev.txt
pip install '.[dev]'
- name: Lint
run: pre-commit run --all-files
- name: Test
Expand All @@ -45,7 +36,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install pypa/build
Expand All @@ -58,8 +49,8 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
33 changes: 17 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1000']
- repo: https://github.com/Zac-HD/shed
rev: 0.5.3
hooks:
- id: shed
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- id: mypy
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=1000"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
- id: ruff-format
8 changes: 7 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ version: 2
sphinx:
configuration: docs/conf.py

build:
os: ubuntu-22.04
tools:
python: "3.12"

python:
install:
- method: pip
path: .
- requirements: requirements-dev.txt
extra_requirements:
- docs
2 changes: 0 additions & 2 deletions mypy.ini

This file was deleted.

33 changes: 25 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
[build-system]
requires = [
"setuptools>=45",
"wheel",
"setuptools_scm>=6.2"
[project]
name = "isd"
version = "0.2.0"
description = "Reads and archives NOAA Integrated Surface Database (ISD) files"
readme = "README.md"
authors = [{ name = "Pete Gadomski", email = "[email protected]" }]
license = { text = "Apache-2.0" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
requires-python = ">=3.7"
dependencies = ["click~=8.0", "pandas~=1.3"]

[project.scripts]
isd = "isd.cli:main"

[project.optional-dependencies]
dev = ["mypy~=1.2", "pre-commit~=3.2", "pytest~=7.4", "ruff~=0.1.9"]
docs = ["sphinx~=7.2"]

[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/isd/_version.py"
local_scheme = "no-local-version"
[tool.mypy]
strict = true
7 changes: 0 additions & 7 deletions requirements-dev.txt

This file was deleted.

31 changes: 0 additions & 31 deletions setup.cfg

This file was deleted.

0 comments on commit 8147230

Please sign in to comment.