diff --git a/poetry.lock b/poetry.lock index eee5a96..21cda60 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "asgiref" @@ -621,24 +621,25 @@ django = ">=3.0" [[package]] name = "docker" -version = "4.2.2" +version = "7.1.0" description = "A Python library for the Docker Engine API." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.8" files = [ - {file = "docker-4.2.2-py2.py3-none-any.whl", hash = "sha256:03a46400c4080cb6f7aa997f881ddd84fef855499ece219d75fbdb53289c17ab"}, - {file = "docker-4.2.2.tar.gz", hash = "sha256:26eebadce7e298f55b76a88c4f8802476c5eaddbdbe38dbc6cce8781c47c9b54"}, + {file = "docker-7.1.0-py3-none-any.whl", hash = "sha256:c96b93b7f0a746f9e77d325bcfb87422a3d8bd4f03136ae8a85b37f1898d5fc0"}, + {file = "docker-7.1.0.tar.gz", hash = "sha256:ad8c70e6e3f8926cb8a92619b832b4ea5299e2831c14284663184e200546fa6c"}, ] [package.dependencies] -pypiwin32 = {version = "223", markers = "sys_platform == \"win32\" and python_version >= \"3.6\""} -requests = ">=2.14.2,<2.18.0 || >2.18.0" -six = ">=1.4.0" -websocket-client = ">=0.32.0" +pywin32 = {version = ">=304", markers = "sys_platform == \"win32\""} +requests = ">=2.26.0" +urllib3 = ">=1.26.0" [package.extras] -ssh = ["paramiko (>=2.4.2)"] -tls = ["cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=17.5.0)"] +dev = ["coverage (==7.2.7)", "pytest (==7.4.2)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.1.0)", "ruff (==0.1.8)"] +docs = ["myst-parser (==0.18.0)", "sphinx (==5.1.1)"] +ssh = ["paramiko (>=2.4.3)"] +websockets = ["websocket-client (>=1.3.0)"] [[package]] name = "dunamai" @@ -1173,20 +1174,6 @@ dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pyte docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] -[[package]] -name = "pypiwin32" -version = "223" -description = "" -optional = false -python-versions = "*" -files = [ - {file = "pypiwin32-223-py3-none-any.whl", hash = "sha256:67adf399debc1d5d14dffc1ab5acacb800da569754fafdc576b2a039485aa775"}, - {file = "pypiwin32-223.tar.gz", hash = "sha256:71be40c1fbd28594214ecaecb58e7aa8b708eabfa0125c8a109ebd51edbd776a"}, -] - -[package.dependencies] -pywin32 = ">=223" - [[package]] name = "pyproject-api" version = "1.6.1" @@ -1359,21 +1346,25 @@ files = [ [[package]] name = "pywin32" -version = "301" +version = "306" description = "Python for Window Extensions" optional = false python-versions = "*" files = [ - {file = "pywin32-301-cp35-cp35m-win32.whl", hash = "sha256:93367c96e3a76dfe5003d8291ae16454ca7d84bb24d721e0b74a07610b7be4a7"}, - {file = "pywin32-301-cp35-cp35m-win_amd64.whl", hash = "sha256:9635df6998a70282bd36e7ac2a5cef9ead1627b0a63b17c731312c7a0daebb72"}, - {file = "pywin32-301-cp36-cp36m-win32.whl", hash = "sha256:c866f04a182a8cb9b7855de065113bbd2e40524f570db73ef1ee99ff0a5cc2f0"}, - {file = "pywin32-301-cp36-cp36m-win_amd64.whl", hash = "sha256:dafa18e95bf2a92f298fe9c582b0e205aca45c55f989937c52c454ce65b93c78"}, - {file = "pywin32-301-cp37-cp37m-win32.whl", hash = "sha256:98f62a3f60aa64894a290fb7494bfa0bfa0a199e9e052e1ac293b2ad3cd2818b"}, - {file = "pywin32-301-cp37-cp37m-win_amd64.whl", hash = "sha256:fb3b4933e0382ba49305cc6cd3fb18525df7fd96aa434de19ce0878133bf8e4a"}, - {file = "pywin32-301-cp38-cp38-win32.whl", hash = "sha256:88981dd3cfb07432625b180f49bf4e179fb8cbb5704cd512e38dd63636af7a17"}, - {file = "pywin32-301-cp38-cp38-win_amd64.whl", hash = "sha256:8c9d33968aa7fcddf44e47750e18f3d034c3e443a707688a008a2e52bbef7e96"}, - {file = "pywin32-301-cp39-cp39-win32.whl", hash = "sha256:595d397df65f1b2e0beaca63a883ae6d8b6df1cdea85c16ae85f6d2e648133fe"}, - {file = "pywin32-301-cp39-cp39-win_amd64.whl", hash = "sha256:87604a4087434cd814ad8973bd47d6524bd1fa9e971ce428e76b62a5e0860fdf"}, + {file = "pywin32-306-cp310-cp310-win32.whl", hash = "sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d"}, + {file = "pywin32-306-cp310-cp310-win_amd64.whl", hash = "sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8"}, + {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, + {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, + {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, + {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, + {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, + {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, + {file = "pywin32-306-cp37-cp37m-win32.whl", hash = "sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65"}, + {file = "pywin32-306-cp37-cp37m-win_amd64.whl", hash = "sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36"}, + {file = "pywin32-306-cp38-cp38-win32.whl", hash = "sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a"}, + {file = "pywin32-306-cp38-cp38-win_amd64.whl", hash = "sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0"}, + {file = "pywin32-306-cp39-cp39-win32.whl", hash = "sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802"}, + {file = "pywin32-306-cp39-cp39-win_amd64.whl", hash = "sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4"}, ] [[package]] @@ -1667,19 +1658,18 @@ testing = ["build[virtualenv] (>=1.0.3)", "covdefaults (>=2.3)", "detect-test-po [[package]] name = "tox-docker" -version = "4.1.0" -description = "Launch a docker instance around test runs" +version = "5.0.0" +description = "Manage lifecycle of docker containers during Tox test runs" optional = false python-versions = "*" files = [ - {file = "tox-docker-4.1.0.tar.gz", hash = "sha256:0317e692dc80f2197eaf9c905dcb8d1d1f9d5bf2686ecfd83c22a1da9d23fb24"}, - {file = "tox_docker-4.1.0-py2.py3-none-any.whl", hash = "sha256:444c72192a2443d2b4db5766545d4413ea683cc488523d770e2e216f15fa3086"}, + {file = "tox_docker-5.0.0-py3-none-any.whl", hash = "sha256:7dd7293ea286dff422eab6c23a70652147b275eb436c02e97a90ac59ba41f8a8"}, + {file = "tox_docker-5.0.0.tar.gz", hash = "sha256:3cbfe70713910b9dbb9f74e20a5c42f19da42d375bac7d6a3ccc11aed0738d7a"}, ] [package.dependencies] -docker = ">=4.0,<7.0" -packaging = "*" -tox = ">=3.0.0,<5.0" +docker = ">=4.0,<8.0" +tox = ">=4.0.0,<5.0" [[package]] name = "tox-gh-actions" @@ -1803,23 +1793,7 @@ files = [ {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"}, ] -[[package]] -name = "websocket-client" -version = "1.4.1" -description = "WebSocket client for Python with low level API options" -optional = false -python-versions = ">=3.7" -files = [ - {file = "websocket-client-1.4.1.tar.gz", hash = "sha256:f9611eb65c8241a67fb373bef040b3cf8ad377a9f6546a12b620b6511e8ea9ef"}, - {file = "websocket_client-1.4.1-py3-none-any.whl", hash = "sha256:398909eb7e261f44b8f4bd474785b6ec5f5b499d4953342fe9755e01ef624090"}, -] - -[package.extras] -docs = ["Sphinx (>=3.4)", "sphinx-rtd-theme (>=0.5)"] -optional = ["python-socks", "wsaccel"] -test = ["websockets"] - [metadata] lock-version = "2.0" python-versions = ">=3.8,<4" -content-hash = "c0c7cfc2350cbf9b71ac36f9600cb833dec0af7663576bf0550f4cc92f7041ac" +content-hash = "dbae4e9fd02d1f7409e31df8ead970f183b75cb15c440ed716f361071dc99e6b" diff --git a/pyproject.toml b/pyproject.toml index 738dab7..f05abc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,7 +114,7 @@ setuptools = "^70.0.0" dunamai = "^1.16" pre-commit = "^3.0" tox = "^4.5" -tox-docker = "^4.0" +tox-docker = "^5.0" tox-gh-actions = "^3.0" [tool.poetry.group.dev.dependencies] diff --git a/tox.ini b/tox.ini index af95573..bc74885 100644 --- a/tox.ini +++ b/tox.ini @@ -13,9 +13,6 @@ docker = docker: db-vlc docker: minio-vlc setenv = - docker: VLC_DEV_DB_HOST=localhost - docker: VLC_DEV_DB_PORT=9010 - docker: VLC_DEV_AWS_S3_ENDPOINT_URL=http://localhost:9011 COVERAGE_FILE = .coverage.{envname} allowlist_externals = poetry @@ -35,8 +32,10 @@ environment = POSTGRES_USER=vlc POSTGRES_PASSWORD=test POSTGRES_DB=test_virtual_library_card_dev -ports = - 9010:5432/tcp +expose = + VLC_DEV_DB_PORT=5432/tcp +host_var = + VLC_DEV_DB_HOST healthcheck_cmd = pg_isready healthcheck_interval = 5 healthcheck_retries = 10 @@ -47,8 +46,10 @@ environment = MINIO_ACCESS_KEY=vlc-minio MINIO_SECRET_KEY=123456789 MINIO_DEFAULT_BUCKETS=vlc-test:download -ports = - 9011:9000/tcp +expose = + VLC_DEV_AWS_S3_ENDPOINT_URL_PORT=9000/tcp +host_var = + VLC_DEV_AWS_S3_ENDPOINT_URL_HOST [gh-actions] python = diff --git a/virtual_library_card/settings/dev.py b/virtual_library_card/settings/dev.py index e437d1b..4ac66dd 100644 --- a/virtual_library_card/settings/dev.py +++ b/virtual_library_card/settings/dev.py @@ -59,9 +59,19 @@ DEFAULT_FILE_STORAGE = "virtual_library_card.storage.S3PublicStorage" STATICFILES_STORAGE = "virtual_library_card.storage.S3StaticStorage" AWS_STORAGE_BUCKET_NAME = "vlc-test" -AWS_S3_ENDPOINT_URL = os.environ.get( - "VLC_DEV_AWS_S3_ENDPOINT_URL", "http://localhost:9000" -) +if "VLC_DEV_AWS_S3_ENDPOINT_URL" in os.environ: + AWS_S3_ENDPOINT_URL = os.environ["VLC_DEV_AWS_S3_ENDPOINT_URL"] +elif ( + "VLC_DEV_AWS_S3_ENDPOINT_URL_HOST" in os.environ + and "VLC_DEV_AWS_S3_ENDPOINT_URL_PORT" in os.environ +): + AWS_S3_ENDPOINT_URL = ( + f"http://{os.environ['VLC_DEV_AWS_S3_ENDPOINT_URL_HOST']}" + f":{os.environ['VLC_DEV_AWS_S3_ENDPOINT_URL_PORT']}" + ) +else: + AWS_S3_ENDPOINT_URL = "http://localhost:9000" + AWS_S3_CUSTOM_DOMAIN = os.environ.get("VLC_DEV_AWS_S3_CUSTOM_DOMAIN", False) AWS_S3_URL_PROTOCOL = os.environ.get("VLC_DEV_AWS_S3_URL_PROTOCOL", "https:")