From b21e9a26891dad115312fafaf23c0a227272bb96 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Thu, 22 Feb 2024 17:33:27 +0100 Subject: [PATCH] refactor: adapt dependency management for v24 --- .github/workflows/test.yml | 8 +++---- .gitignore | 2 ++ Makefile | 15 ++++-------- poetry.lock | 47 +++++++++++++++++++++++++++++++++++++- pyproject.toml | 4 ++++ 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 132f98d..5502320 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,8 +65,6 @@ jobs: run: yarn set version 1.22.21 - run: | sudo apt-get update && sudo apt-get install -y libxmlsec1-dev libmaxminddb-dev - python3 -m venv venv - . venv/bin/activate - venv/bin/pip3 install -U wheel - make develop - make test + poetry install --with test + make deps + poetry run pytest diff --git a/.gitignore b/.gitignore index 98f501a..4326e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ venv .venv .coverage .vscode/ +# Fetched from upstream +requirements-sentry.txt diff --git a/Makefile b/Makefile index b3c0090..0f65cc0 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,10 @@ SENTRY_VERSION := 24.2.0 -.PHONY: clean develop test +.PHONY: clean deps -develop: - pip3 install -e git+https://github.com/getsentry/sentry.git@$(SENTRY_VERSION)#egg=sentry[dev] - poetry install -n --no-dev - poetry build && pip3 install -U dist/*.whl - pip3 install -U codecov pytest freezegun fixtures - -test: - @echo "--> Running Python tests" - python -m pytest tests || exit 1 - @echo "" +deps: + curl -L -o requirements-sentry.txt https://github.com/getsentry/sentry/raw/$(SENTRY_VERSION)/requirements-dev-frozen.txt + poetry run pip install requirements-sentry.txt clean: rm -rf *.egg-info src/*.egg-info diff --git a/poetry.lock b/poetry.lock index 1baae1d..42d597a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -262,6 +262,25 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "fixtures" +version = "4.1.0" +description = "Fixtures, reusable state for writing clean tests and more." +optional = false +python-versions = ">=3.7" +files = [ + {file = "fixtures-4.1.0-py3-none-any.whl", hash = "sha256:a43a55da406c37651aa86dd1ba6c3983a09d36d60fe5f72242872c8a4eeeb710"}, + {file = "fixtures-4.1.0.tar.gz", hash = "sha256:82b1c5e69f615526ef6c067188a1e6c6067df7f88332509c99f8b8fdbb9776f3"}, +] + +[package.dependencies] +pbr = ">=5.7.0" + +[package.extras] +docs = ["docutils"] +streams = ["testtools"] +test = ["mock", "testtools"] + [[package]] name = "flake8" version = "3.9.2" @@ -358,6 +377,17 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] +[[package]] +name = "pbr" +version = "6.0.0" +description = "Python Build Reasonableness" +optional = false +python-versions = ">=2.6" +files = [ + {file = "pbr-6.0.0-py2.py3-none-any.whl", hash = "sha256:4a7317d5e3b17a3dccb6a8cfe67dab65b20551404c52c8ed41279fa4f0cb4cda"}, + {file = "pbr-6.0.0.tar.gz", hash = "sha256:d1377122a5a00e2f940ee482999518efe16d745d423a670c27773dfbc3c9a7d9"}, +] + [[package]] name = "platformdirs" version = "4.2.0" @@ -453,6 +483,21 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "sentry" +version = "24.2.0" +description = "A realtime logging and aggregation server." +optional = false +python-versions = ">=3.8" +files = [] +develop = false + +[package.source] +type = "git" +url = "https://github.com/getsentry/sentry.git" +reference = "24.2.0" +resolved_reference = "cfcff1f4fda857dcddc9401efb689b6af92a3214" + [[package]] name = "tomli" version = "2.0.1" @@ -484,4 +529,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "02daee215ddae2f6a8a3bdce83fb30a7af8cb83d332b3ea77aec1895fe03685e" +content-hash = "bf77682cd0a709c366445882666a27264fe78c71d6de312f7e982e5e95775df2" diff --git a/pyproject.toml b/pyproject.toml index f201a57..10e31ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,8 +22,12 @@ python = "^3.10" black = "^22.8.0" isort = "^5.7.0" flake8 = "^3.8.4" + +[tool.poetry.group.test.dependencies] codecov = "^2.1.12" pytest = "^7.1.3" +sentry = {git = "https://github.com/getsentry/sentry.git", rev = "24.2.0"} +fixtures = "^4.1.0" [tool.isort] profile = "black"