diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 64ad198..fe47b7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e264381..a14449a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 04c965e..0ef0b70 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -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 diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index b1efbe8..0000000 --- a/mypy.ini +++ /dev/null @@ -1,2 +0,0 @@ -[mypy] -strict = True diff --git a/pyproject.toml b/pyproject.toml index 7bf401c..7f3c5fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "pete.gadomski@gmail.com" }] +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 diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index e4abbcc..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,7 +0,0 @@ -mypy -pandas-stubs -pre-commit -pytest -shed -sphinx -tqdm diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 55d639d..0000000 --- a/setup.cfg +++ /dev/null @@ -1,31 +0,0 @@ -[metadata] -name = isd -author = Pete Gadomski -author_email = pete.gadomski@gmail.com -description = Reads and archives NOAA Integrated Surface Database (ISD) files -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/gadomski/pyisd -project_urls = - Bug Tracker = https://github.com/gadomski/pyisd/issues -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -package_dir = - = src -packages = find: -python_requires = >=3.7 -install_requires = - click ~= 8.0 - pandas ~= 1.3 - - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - isd = isd.cli:main