-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from kentbull/bump-version-upgrade-deps
chore,test: bump version to 0.2.2; upgrade deps; cleanup code
- Loading branch information
Showing
9 changed files
with
83 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,14 +27,23 @@ | |
from glob import glob | ||
from os.path import basename | ||
from os.path import splitext | ||
from pathlib import Path | ||
|
||
from setuptools import find_packages, setup | ||
|
||
this_directory = Path(__file__).parent | ||
if (this_directory / "README.md").exists(): # If building inside a container, like in the `container/Dockerfile`, this file won't exist and fails the build | ||
long_description = (this_directory / "README.md").read_text() | ||
else: | ||
long_description = "Verifiable Legal Entity Identifier Schema Generator and Server" | ||
|
||
setup( | ||
name='vlei', | ||
version='0.2.1', # also change in src/vlei/__init__.py | ||
version='0.2.2', # also change in src/vlei/__init__.py | ||
license='Apache Software License 2.0', | ||
description='Verifiable Legal Entity Identifier', | ||
long_description="Verifiable Legal Entity Identifier Schema Generator and Server", | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
author='Samuel M. Smith', | ||
author_email='[email protected]', | ||
url='https://github.com/WebOfTrust/vLEI', | ||
|
@@ -65,32 +74,20 @@ | |
], | ||
python_requires='>=3.12.2', | ||
install_requires=[ | ||
'lmdb>=1.4.1', | ||
'pysodium>=0.7.17', | ||
'blake3>=0.4.1', | ||
'msgpack>=1.0.8', | ||
'cbor2>=5.6.2', | ||
'multidict>=6.0.5', | ||
'ordered-set>=4.1.0', | ||
'hio==0.6.14', | ||
'multicommand>=1.0.0', | ||
'jsonschema>=4.21.1', | ||
'falcon>=3.1.3', | ||
'daemonocle>=1.2.3', | ||
'hjson>=3.1.0', | ||
'PyYaml>=6.0.2', | ||
'apispec>=6.8.0', | ||
'mnemonic>=0.21', | ||
'keri>=1.2.1', | ||
'keri>=1.2.2', | ||
'falcon>=4.0.2', | ||
'multicommand>=1.0.0' | ||
], | ||
extras_require={ | ||
}, | ||
tests_require=[ | ||
'coverage>=7.4.4', | ||
'pytest>=8.1.1', | ||
'requests==2.32.3' | ||
'coverage>=7.6.10', | ||
'pytest>=8.3.4', | ||
'requests==2.32.3' | ||
], | ||
setup_requires=[ | ||
'setuptools==75.8.0' | ||
], | ||
entry_points={ | ||
'console_scripts': [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
__version__ = '0.2.1' # also change in setup.py | ||
__version__ = '0.2.2' # also change in setup.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import multiprocessing | ||
import os | ||
import signal | ||
import time | ||
|
||
import requests | ||
|
||
from vlei import server | ||
|
||
|
||
def wait_for_server(port, timeout=10): | ||
"""Poll server until it responds or until timeout""" | ||
url=f"http://127.0.0.1:{port}/health" | ||
start_time=time.time() | ||
while time.time() - start_time < timeout: | ||
try: | ||
response = requests.get(url) | ||
if response.status_code == 200: | ||
return True # Server is up | ||
except requests.ConnectionError: | ||
pass # Server not ready yet | ||
time.sleep(0.25) # Retry every 1/4 second | ||
return False # Timeout | ||
|
||
def test_shutdown_signals(): | ||
config = server.VLEIConfig(http=9999) | ||
|
||
# Test SIGTERM | ||
vlei_process = multiprocessing.Process(target=server.launch, args=[config]) | ||
vlei_process.start() | ||
assert wait_for_server(config.http), "vLEI-server did not start as expected." | ||
|
||
os.kill(vlei_process.pid, signal.SIGTERM) # Send SigTerm to the process, signal 15 | ||
vlei_process.join(timeout=10) | ||
assert not vlei_process.is_alive(), "SIGTERM: vLEI-server process did not shut down as expected." | ||
assert vlei_process.exitcode == 0, f"SIGTERM: vLEI-server exited with non-zero exit code {vlei_process.exitcode}" | ||
|
||
# Test SIGINT | ||
vlei_process = multiprocessing.Process(target=server.launch, args=[config]) | ||
vlei_process.start() | ||
assert wait_for_server(config.http), "Agency did not start as expected." | ||
|
||
os.kill(vlei_process.pid, signal.SIGINT) # Sends SigInt to the process, signal 2 | ||
vlei_process.join(timeout=10) | ||
assert not vlei_process.is_alive(), "SIGINT: vLEI-server process did not shut down as expected." | ||
assert vlei_process.exitcode == 0, f"SIGINT: vLEI-server exited with non-zero exit code {vlei_process.exitcode}" |