Skip to content

Commit

Permalink
Modify build (#60)
Browse files Browse the repository at this point in the history
* Move examples

* Migrate to Hatch

* Update docs
  • Loading branch information
g4brielvs authored Feb 15, 2024
1 parent 2ee961a commit 670b006
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 36 deletions.
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ repos:
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell --skip="*.js,*.html,*.css, *.svg"
exclude: |
(?x)^(
examples/blackmarblepy.ipynb|
examples/quality-assessment.ipynb|
)$
description: Checks for common misspellings in text files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ When using **BlackMarblePy**, your support is much appreciated! Please consider
title = {{BlackMarblePy: Georeferenced Rasters and Statistics of Nighttime Lights from NASA Black Marble}},
author = {Gabriel {Stefanini Vicente} and Robert Marty},
year = {2023},
note = {{BlackMarblePy} v0.2.2},
note = {{BlackMarblePy} v0.2.3},
url = {https://worldbank.github.io/blackmarblepy},
}
```
Expand Down
8 changes: 5 additions & 3 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ parts:
- file: CONTRIBUTING
- caption: Examples
chapters:
- file: examples/blackmarblepy.ipynb
- file: examples/quality-assessment.ipynb
- file: notebooks/blackmarblepy.ipynb
- file: notebooks/quality-assessment.ipynb
- url: https://blogs.worldbank.org/opendata/illuminating-insights-harnessing-nasas-black-marble-r-and-python-packages?auHash=U6q7khcBvDa_eUrNze0tnZkLg5TuvggWL18OTWQYmCA
title: "Illuminating insights: harnessing NASA's Black Marble with R and Python packages"
- url: https://datapartnership.github.io/gaza-israel-conflict-impact-analysis/notebooks/nighttime-lights/nighttime-lights.html
title: Nighttime Lights Trends in Gaza and West Bank
title: "Nighttime Lights Trends in Gaza and West Bank"
2 changes: 1 addition & 1 deletion docs/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ @misc{blackmarblepy
title = {{BlackMarblePy: Georeferenced Rasters and Statistics of Nighttime Lights from NASA Black Marble}},
author = {Gabriel {Stefanini Vicente} and Robert Marty},
year = {2023},
note = {{BlackMarblePy} v0.2.2},
note = {{BlackMarblePy} v0.2.3},
url = {https://worldbank.github.io/blackmarblepy},
}

Expand Down
8 changes: 1 addition & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# If you wish to continue using _config.yml, make edits to that file and
# re-generate this one.
###############################################################################
import os

apidoc_module_dir = "../src"
author = "Development Data Group"
bibtex_bibfiles = ["bibliography.bib"]
Expand Down Expand Up @@ -52,7 +50,7 @@
"extra_footer": "",
"home_page_in_toc": False,
"announcement": "",
"analytics": {"google_analytics_id": ""},
"analytics": {"google_analytics_id": "G-ZWF69GP65G"},
"use_repository_button": True,
"use_edit_page_button": True,
"use_issues_button": True,
Expand All @@ -79,7 +77,3 @@
suppress_warnings = ["myst.domains"]
use_jupyterbook_latex = True
use_multitoc_numbering = True

if os.getenv("GITHUB_ACTIONS"):
extensions.append("sphinxcontrib.googleanalytics")
googleanalytics_id = "G-ZWF69GP65G"
1 change: 0 additions & 1 deletion docs/examples

This file was deleted.

1 change: 1 addition & 0 deletions docs/notebooks
File renamed without changes.
File renamed without changes.
31 changes: 19 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[build-system]
requires = ["setuptools>=64.0.0"]
build-backend = "setuptools.build_meta"
requires = ["hatchling>=1.21.0", "hatch-vcs>=0.3.0"]
build-backend = "hatchling.build"

[project]
name = "blackmarblepy"
dynamic = ["version"]
description = "Georeferenced Rasters of Nighttime Lights from NASA Black Marble data"
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
keywords = ["nighttime lights", "nasa", "black marble", "world bank"]
keywords = ["nighttime lights", "nasa black marble", "world bank"]
authors = [{ name = "World Bank", email = "github@worldbank.org" }]
maintainers = [
{ name = "Gabriel Stefanini Vicente", email = "gvicente@worldbank.org" },
Expand Down Expand Up @@ -43,23 +42,31 @@ dependencies = [
"xarray",
"aiohttp",
]
dynamic = ["version"]

[project.optional-dependencies]
docs = [
"docutils==0.17.1", # https://jupyterbook.org/en/stable/content/citations.html?highlight=docutils#citations-and-bibliographies
"docutils==0.17.1", # https://jupyterbook.org/en/stable/content/citations.html?highlight=docutils#citations-and-bibliographies
"jupyter-book>=0.15.1",
"sphinxcontrib-apidoc>=0.4.0,<1",
"sphinxcontrib-googleanalytics>=0.4",
"docutils==0.17.1",
]
tests = ["pytest"]

[project.urls]
"Homepage" = "https://github.com/worldbank/blackmarblepy"
"Homepage" = "https://worldbank.github.io/blackmarblepy"
"Bug Reports" = "https://github.com/worldbank/blackmarblepy/issues"
"Source" = "https://github.com/worldbank/blackmarblepy"

[tool.setuptools.dynamic]
version = { file = "src/blackmarble/VERSION" }
[tool.hatch.version]
source = "vcs"

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

[tool.codespell]
skip = 'docs/_build,docs/references.bib,__pycache__,*.png,*.gz,*.whl'
ignore-regex = '^\s*"image\/png":\s.*'
ignore-words-list = "gost,"

[tool.setuptools.package-data]
"blackmarble.data" = ["blackmarbletiles.geojson"]
[tool.ruff.pydocstyle]
convention = "numpy"
1 change: 0 additions & 1 deletion src/blackmarble/VERSION

This file was deleted.

3 changes: 0 additions & 3 deletions src/blackmarble/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import logging
from pathlib import Path

__version__ = (Path(__file__).parent / "VERSION").read_text().strip()

logging.basicConfig(
format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s",
Expand Down

0 comments on commit 670b006

Please sign in to comment.