Skip to content

Commit

Permalink
Apparently working?
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-bryson committed Dec 18, 2023
1 parent 2855ae1 commit 3d98976
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ build-dist: clean-dist ## Builds new package dist
clean-dist: ## Cleans dist dir
rm -rf dist/*

test: ## Run poetry tests, ignores ckan load
test: up ## Runs poetry tests, ignores ckan load
poetry run pytest --ignore=./tests/load/ckan

up: ## Sets up local docker environment
docker compose up -d

# Output documentation for top-level targets
# Thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
Expand Down
4 changes: 4 additions & 0 deletions harvester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
"json": "application/json",
}
extract_feat_name = "extract"

from . import compare, extract, load, transform
from .validate import dcat_us
from .utils import json
6 changes: 3 additions & 3 deletions harvester/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
logger = logging.getLogger("harvester")


def compare():
# stub, TODO complete
def compare(compare_obj):
"""Compares records"""
logger.info("Hello from harvester.compare()")

# stub

pass
return compare_obj
6 changes: 3 additions & 3 deletions harvester/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
logger = logging.getLogger("harvester")


def transform():
# stub, TODO complete
def transform(transform_obj):
"""Transforms records"""
logger.info("Hello from harvester.transform()")

# stub

pass
return transform_obj
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datagov-harvesting-logic"
version = "0.0.2-2"
version = "0.0.2-4"
description = ""
# authors = [
# {name = "Jin Sun", email = "[email protected]"},
Expand All @@ -14,7 +14,7 @@ maintainers = [
]
readme = "README.md"
packages = [{include = "harvester"}]
license = "LICENSE.md"
license = "LICENSE.md" # TODO fix me
repository = "https://github.com/GSA/datagov-harvesting-logic"

[tool.poetry.dependencies]
Expand Down Expand Up @@ -79,5 +79,5 @@ max-complexity = 10


[build-system]
requires = ["poetry-core"]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
12 changes: 12 additions & 0 deletions tests/compare/test_compare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from harvester.compare import compare

def test_compare():
"""tests compare
"""

# stub, TODO complete
test_compare = "some test messsage"
compare_response = compare(test_compare)

assert test_compare == compare_response
12 changes: 12 additions & 0 deletions tests/transform/test_transform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from harvester.transform import transform

def test_transform():
"""tests transform
"""

# stub, TODO complete
test_transform = "some test messsage"
transform_response = transform(test_transform)

assert test_transform == transform_response

0 comments on commit 3d98976

Please sign in to comment.