Skip to content

Commit

Permalink
Change Versioning (#38)
Browse files Browse the repository at this point in the history
* Migrate to setuptools_scm

* Rename package
  • Loading branch information
g4brielvs authored Feb 9, 2024
1 parent 36d1c5e commit 2efa62b
Show file tree
Hide file tree
Showing 9 changed files with 436 additions and 131 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ _build/

# python-dotenv
.env

# setuptools-scm/
src/*/_version.py
8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

12 changes: 3 additions & 9 deletions notebooks/world-bank-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"tags": []
},
"source": [
"# Indicators Example\n",
"# World Bank Indicators API Example\n",
"\n",
"> The following is an example of a [Jupyter notebook](https://jupyter.org) - a tutorial of how to retrieve data from the [World Bank Indicators API](https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation) - that illustrates how to use computational content with the [template](https://worldbank.github.io/template). "
]
Expand Down Expand Up @@ -41,13 +41,7 @@
"id": "fb8d2738-535e-4957-b82a-987891955a7f",
"metadata": {},
"source": [
"## Retrieve Data\n",
"\n",
"https://data.worldbank.org/indicator\n",
"\n",
"\n",
"https://databank.worldbank.org/reports.aspx?source=World-Development-Indicators\n",
"\n",
"## Data Retrieval\n",
"\n",
"In this example, we retrieve **Population, total** (`SP.POP.TOTL`) from the [World Bank Indicators](https://data.worldbank.org/indicator) for [BRICS](https://infobrics.org)."
]
Expand Down Expand Up @@ -701,7 +695,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.12.1"
},
"vscode": {
"interpreter": {
Expand Down
513 changes: 415 additions & 98 deletions notebooks/world-bank-package.ipynb

Large diffs are not rendered by default.

20 changes: 8 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
[build-system]
requires = ["setuptools>=61.0.0"]
requires = ["setuptools>=64.0.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "datalab"
name = "template"
dynamic = ["version"]
description = "An Python exampe package from the World Bank Data Lab"
description = "A template Python package from the World Bank Data Lab"
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
keywords = ["template", "reproducible research"]
keywords = ["template", "reproducibility"]
authors = [{ name = "Development Data Group", email = "datalab@worldbank.org" }]
maintainers = [
{ name = "Gabriel Stefanini Vicente", email = "gvicente@worldbank.org" },
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
Expand All @@ -26,18 +23,17 @@ classifiers = [
"Operating System :: OS Independent",
]
requires-python = ">=3.7"
dependencies = ["requests>=2.28.1", "pycountry>=22.3.5"]
dependencies = ["requests>=2.28.1", "pandas>=2", "pycountry>=22.3.5"]
[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 >=1,<2",
]
notebook = ["notebook>=6.5.2"]

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

[tool.setuptools.dynamic]
version = { attr = "datalab.__version__" }
[tool.setuptools_scm]
write_to = "src/template/_version.py"
1 change: 0 additions & 1 deletion src/datalab/VERSION

This file was deleted.

3 changes: 0 additions & 3 deletions src/datalab/__init__.py

This file was deleted.

7 changes: 7 additions & 0 deletions src/template/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("datalab")
except PackageNotFoundError:
# package is not installed
pass
File renamed without changes.

0 comments on commit 2efa62b

Please sign in to comment.