Skip to content

Commit 059d9d7

Browse files
Merge pull request #1 from OpenDataServices/setup
Setup project boilerplate
2 parents b1f65f9 + 2b6b9ba commit 059d9d7

File tree

9 files changed

+161
-1
lines changed

9 files changed

+161
-1
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on: [push]
3+
4+
jobs:
5+
ci:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version: "3.12"
12+
- name: Install dev requirements
13+
run: pip install -r requirements_dev.txt
14+
- name: Check black
15+
run: black --check oc4ids_datastore_pipeline/ tests/
16+
- name: Check isort
17+
run: isort --check-only oc4ids_datastore_pipeline/ tests/
18+
- name: Check flake8
19+
run: flake8 oc4ids_datastore_pipeline/ tests/
20+
- name: Check mypy
21+
run: mypy oc4ids_datastore_pipeline/ tests/
22+
- name: Run tests
23+
run: pytest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
__pycache__

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
# oc4ids-datastore-pipeline
1+
# OC4IDS Datastore Pipeline
2+
3+
A Python application to validate and store published OC4IDS datasets.
4+
5+
## Local Development
6+
7+
### Prerequisites
8+
9+
- Python 3.12
10+
11+
### Install Python requirements
12+
13+
```
14+
python -m venv .venv
15+
source .venv/bin/activate
16+
pip install -r requirements_dev.txt
17+
```
18+
19+
### Run app
20+
21+
```
22+
pip install -e .
23+
oc4ids-datastore-pipeline
24+
```
25+
26+
### Run linting and type checking
27+
28+
```
29+
black oc4ids_datastore_pipeline/ tests/
30+
isort oc4ids_datastore_pipeline/ tests/
31+
flake8 oc4ids_datastore_pipeline/ tests/
32+
mypy oc4ids_datastore_pipeline/ tests/
33+
```
34+
35+
### Run tests
36+
37+
```
38+
pytest
39+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import logging
2+
import time
3+
4+
logging.basicConfig(
5+
level=logging.INFO,
6+
format="%(asctime)s:%(levelname)s:%(name)s:%(message)s",
7+
datefmt="%Y-%m-%dT%H:%M:%S",
8+
)
9+
logging.Formatter.converter = time.gmtime
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import logging
2+
3+
logger = logging.getLogger(__name__)
4+
5+
6+
def run() -> None:
7+
logger.info("Hello World!")

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[build-system]
2+
requires = ["flit_core >=3.2,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[project]
6+
name = "oc4ids-datastore-pipeline"
7+
description = "OC4IDS Datastore Pipeline"
8+
version = "0.1.0"
9+
readme = "README.md"
10+
dependencies = []
11+
12+
[project.optional-dependencies]
13+
dev = [
14+
"black",
15+
"isort",
16+
"flake8",
17+
"Flake8-pyproject",
18+
"mypy",
19+
"pytest",
20+
]
21+
22+
[project.scripts]
23+
oc4ids-datastore-pipeline = "oc4ids_datastore_pipeline.pipeline:run"
24+
25+
[tool.isort]
26+
profile = "black"
27+
28+
[tool.flake8]
29+
max-line-length = 88
30+
31+
[tool.mypy]
32+
strict = true

requirements_dev.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --extra=dev --output-file=requirements_dev.txt pyproject.toml
6+
#
7+
black==25.1.0
8+
# via oc4ids-datastore-pipeline (pyproject.toml)
9+
click==8.1.8
10+
# via black
11+
flake8==7.1.1
12+
# via
13+
# flake8-pyproject
14+
# oc4ids-datastore-pipeline (pyproject.toml)
15+
flake8-pyproject==1.2.3
16+
# via oc4ids-datastore-pipeline (pyproject.toml)
17+
iniconfig==2.0.0
18+
# via pytest
19+
isort==6.0.0
20+
# via oc4ids-datastore-pipeline (pyproject.toml)
21+
mccabe==0.7.0
22+
# via flake8
23+
mypy==1.14.1
24+
# via oc4ids-datastore-pipeline (pyproject.toml)
25+
mypy-extensions==1.0.0
26+
# via
27+
# black
28+
# mypy
29+
packaging==24.2
30+
# via
31+
# black
32+
# pytest
33+
pathspec==0.12.1
34+
# via black
35+
platformdirs==4.3.6
36+
# via black
37+
pluggy==1.5.0
38+
# via pytest
39+
pycodestyle==2.12.1
40+
# via flake8
41+
pyflakes==3.2.0
42+
# via flake8
43+
pytest==8.3.4
44+
# via oc4ids-datastore-pipeline (pyproject.toml)
45+
typing-extensions==4.12.2
46+
# via mypy

tests/test_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_hello_world() -> None:
2+
pass

0 commit comments

Comments
 (0)