Skip to content

Commit

Permalink
Merge pull request #106 from RalphTro/105
Browse files Browse the repository at this point in the history
Making sure that static json ld context for file loader is included in package
  • Loading branch information
Echsecutor authored May 16, 2023
2 parents 4fe3de1 + e314bbc commit 3a9b451
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 11 deletions.
13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EPCIS Event Hash Generator Changelog


WIP (changes since last release)
---


1.9.3 (2023-05-16)
---

- Added Changelog
- Migrating from `setup.py` to `build` for the package build
- Making sure that static JSON-LD context files for the context loader are included in the package
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include epcis_event_hash_generator *.jsonld
2 changes: 1 addition & 1 deletion epcis_event_hash_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@
"""


jsonld.set_document_loader(file_document_loader.file_document_loader())
jsonld.set_document_loader(file_document_loader.file_document_loader(timeout=10))
4 changes: 2 additions & 2 deletions epcis_event_hash_generator/file_document_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def file_document_loader(secure=False, **kwargs):

context_file_hashes = {
"https://gs1.github.io/EPCIS/epcis-context.jsonld":
"14b10c9d3e92d35f577bfc610fe5ec15aa2941124987919389d7cd9998516861",
"14b10c9d3e92d35f577bfc610fe5ec15aa2941124987919389d7cd9998516861.jsonld",
"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld":
"e532647e8eb371379b8b0e8602d8981c8566bc60f7351f22c76a5bc865962008"
"e532647e8eb371379b8b0e8602d8981c8566bc60f7351f22c76a5bc865962008.jsonld"
}

def loader(url, options={}):
Expand Down
17 changes: 11 additions & 6 deletions pypi_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1

echo "Publishing Package from $(pwd)"

echo -e "[...]\t removing old artefacts"
rm -rf *.egg-info
rm -rf build
rm -rf dist
rm -rf */__pycache__
echo -e "[ok]\t removing artefacts"

echo
echo -e "[...]\t testing"
$PYTHON -m pip install -r requirements.txt
flake8
cd tests
pytest
cd ..
#$PYTHON -m pip install -e .
$PYTHON -m pip install -e .
echo -e "[ok]\t testing"

echo
echo -e "[...]\t building"
$PYTHON -m pip install --upgrade setuptools
$PYTHON setup.py sdist
$PYTHON -m pip install --upgrade wheel
$PYTHON setup.py bdist_wheel --universal
$PYTHON -m pip install --upgrade setuptools build wheel
$PYTHON -m build
echo -e "[ok]\t building"

echo
Expand All @@ -35,7 +40,7 @@ $PYTHON -m twine upload dist/*
echo -e "[ok]\t uploaded"
echo
echo -e "[...]\t installing from PyPI via"
COMMAND="$PYTHON -m pip install epcis_event_hash_generator"
COMMAND="$PYTHON -m pip install --upgrade epcis_event_hash_generator"
echo $COMMAND
echo
$COMMAND
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setuptools.setup(
name="epcis-event-hash-generator",
keywords="epcis GS1 hashing traceability",
version="1.9.0",
version="1.9.3",
author="""Package author: Sebastian Schmittner
Code authors: https://github.com/RalphTro/epcis-event-hash-generator/graphs/contributors""",
author_email="sebastian.schmittner@eecc.de",
Expand All @@ -31,6 +31,7 @@
install_requires=[
'python_dateutil>=2.8',
'Flask>=1.1',
'PyLD==2.0.3'
'PyLD>=2.0.3'
],
include_package_data=True,
)

0 comments on commit 3a9b451

Please sign in to comment.