Skip to content
Merged
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
File renamed without changes.
7 changes: 3 additions & 4 deletions .config/pre-commit-config.yaml → .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ repos:
- id: end-of-file-fixer
- id: check-ast
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
rev: v0.9.10
hooks:
# Run the linter.
- id: ruff
args: [--config, .config/ruff.toml, --fix]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
args: [--config, .config/ruff.toml]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.29
rev: 0.6.5
hooks:
# Run the pip compile
- id: pip-compile
Expand Down
18 changes: 8 additions & 10 deletions documentation/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Required
version: 2

mkdocs:
configuration: docs/mkdocs.yml
fail_on_warning: false

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.12"
jobs:
pre_build:
- pip install --upgrade mkdocs
- pip install mkdocs-material
- pip install pydoc-markdown
- pydoc-markdown documentation/pydoc-markdown.yaml
- pip install .[docs]

mkdocs:
configuration: documentation/mkdocs.yaml
File renamed without changes.
25 changes: 25 additions & 0 deletions documentation/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
site_name: HDX Python API
repo_url: https://github.com/OCHA-DAP/hdx-python-api/
repo_name: OCHA-DAP/hdx-python-api
docs_dir: .
site_dir: ../site
theme:
name: material
highlightjs: true
plugins:
- search
- mkapi
nav:
- Home: index.md
- API Documentation:
- Configuration: $src/hdx.api.configuration.*
- Locations: $src/hdx.api.locations.*
- Dataset: $src/hdx.data.dataset.*
- Resource: $src/hdx.data.resource.*
- Resource View: $src/hdx.data.resource_view.*
- Showcase: $src/hdx.data.showcase.*
- User: $src/hdx.data.user.*
- Organization: $src/hdx.data.organization.*
- Vocabulary: $src/hdx.data.vocabulary.*
- Simple Facade: $src/hdx.facades.simple.*
- Keyword Arguments Facade: $src/hdx.facades.keyword_arguments.*
58 changes: 0 additions & 58 deletions documentation/pydoc-markdown.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build

[build.targets.wheel]
packages = ["src/hdx"]

[build.hooks.vcs]
version-file = "src/hdx/api/_version.py"

[metadata]
allow-direct-references = true

# Versioning

[version]
source = "vcs"

[version.raw-options]
local_scheme = "no-local-version"
version_scheme = "python-simplified-semver"

# Tests

[envs.hatch-test]
features = ["test"]

[[envs.hatch-test.matrix]]
python = ["3.12"]

[envs.hatch-test.scripts]
run = """
pytest --rootdir=. --junitxml=test-results.xml --cov --no-cov-on-fail \
--cov-report=lcov --cov-report=term-missing
"""

[envs.hatch-static-analysis]
config-path = "none"
dependencies = ["ruff==0.9.10"]
54 changes: 3 additions & 51 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ dependencies = [
"ckanapi>=4.8",
"defopt>=6.4.0",
"email_validator",
"hdx-python-country>=3.8.8",
"hdx-python-utilities>=3.8.3",
"hdx-python-country>=3.9.2",
"hdx-python-utilities>=3.8.6",
"libhxl>=5.2.2",
"makefun",
"quantulum3",
Expand All @@ -56,52 +56,4 @@ Homepage = "https://github.com/OCHA-DAP/hdx-python-api"
[project.optional-dependencies]
test = ["pytest", "pytest-check", "pytest-cov", "gspread"]
dev = ["pre-commit"]


#########
# Hatch #
#########

# Build

[tool.hatch.build.targets.wheel]
packages = ["src/hdx"]

[tool.hatch.build.hooks.vcs]
version-file = "src/hdx/api/_version.py"

[tool.hatch.metadata]
allow-direct-references = true

# Versioning

[tool.hatch.version]
source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
version_scheme = "python-simplified-semver"

# Tests

[tool.hatch.envs.hatch-test]
features = ["test"]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.12"]

[tool.hatch.envs.hatch-test.scripts]
run = """
pytest -c .config/pytest.ini --rootdir=. --junitxml=test-results.xml \
--cov --cov-config=.config/coveragerc --no-cov-on-fail \
--cov-report=lcov --cov-report=term-missing
"""

[tool.hatch.envs.hatch-static-analysis]
dependencies = ["ruff==0.9.6"]

[tool.hatch.envs.hatch-static-analysis.scripts]
format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",]
format-fix = ["ruff format --config .config/ruff.toml {args:.}",]
lint-check = ["ruff check --config .config/ruff.toml {args:.}",]
lint-fix = ["ruff check --config .config/ruff.toml --fix {args:.}",]
docs = ["mkapi"]
2 changes: 1 addition & 1 deletion .config/pytest.ini → pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pytest]
pythonpath = ../src
pythonpath = src
addopts = "--color=yes"
log_cli = 1
Loading
Loading