Skip to content

Commit

Permalink
Build + CI (#36)
Browse files Browse the repository at this point in the history
* ci: Create basic CI

* chore: ruff ignore notebooks

* build: pyproject.toml, use setuptools-scm, ruff

* fix: version information
  • Loading branch information
DahnJ authored Mar 2, 2025
1 parent 258e868 commit d879c8a
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 2,565 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ branch = True
source = h3_pandas
omit =
setup.py
versioneer.py
h3pandas/_version.py

[report]
Expand Down
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: myenv
environment-file: environment.yml

- name: Install development dependencies
shell: bash -l {0}
run: |
conda env update --file environment-dev.yml
- name: ruff check
shell: bash -l {0}
run: |
ruff check .
- name: pytest
shell: bash -l {0}
run: |
pytest tests/
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
rev: v0.9.9
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.1
hooks:
- id: codespell
args: ['--config', '.codespellrc']
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ include README.md
include LICENSE
graft h3pandas
recursive-include * *.py[co]
include versioneer.py
include h3pandas/_version.py
2 changes: 2 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ channels:
- conda-forge
dependencies:
# Test
- ruff
- pytest
- pytest-cov
- setuptools-scm
9 changes: 6 additions & 3 deletions h3pandas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from . import h3pandas # noqa: F401s

from ._version import get_versions
from importlib.metadata import version, PackageNotFoundError

__version__ = get_versions()["version"]
del get_versions
try:
__version__ = version("package-name")
except PackageNotFoundError:
# package is not installed
pass
Loading

0 comments on commit d879c8a

Please sign in to comment.