Changes to payment models #32

Merged
valberg merged 35 commits from benjaoming/membersystem:payment-updates into main 2024-08-03 17:55:33 +00:00
4 changed files with 55 additions and 33 deletions
Showing only changes of commit 78b3264bb6 - Show all commits

View file

@ -1,3 +1,4 @@
.PHONY: run pre_commit_install pre_commit_run_all makemigrations migrate createsuperuser shell manage_command build requirements
DOCKER_COMPOSE = COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose DOCKER_COMPOSE = COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose
DOCKER_RUN = ${DOCKER_COMPOSE} run -u `id -u` DOCKER_RUN = ${DOCKER_COMPOSE} run -u `id -u`
MANAGE_EXEC = python /app/src/manage.py MANAGE_EXEC = python /app/src/manage.py
@ -29,3 +30,6 @@ manage_command:
build: build:
${DOCKER_COMPOSE} build ${DOCKER_COMPOSE} build
requirements:
hatch run dev:requirements

View file

@ -23,7 +23,8 @@ dependencies = [
"django-registries==0.0.3", "django-registries==0.0.3",
"django-view-decorator==0.0.4", "django-view-decorator==0.0.4",
"django-oauth-toolkit==2.4.0", "django-oauth-toolkit==2.4.0",
"django_stubs_ext", "django_stubs_ext~=5.0",
benjaoming marked this conversation as resolved
Review

Noting that this got reintroduced... I don't use it... but is it used? Or did you remove it on purpose @valberg ?

Noting that this got reintroduced... I don't use it... but is it used? Or did you remove it on purpose @valberg ?
Review

I did not do it on purpose no 😊 my all means remove it if it is isn't being used

I did not do it on purpose no 😊 my all means remove it if it is isn't being used
Review

Oh god now I know what's going on... it's for the mypy django-stubs thing...

Yes, we need it for running mypy with Django. I think I spend 2 minutes to get it working. But I didn't actually fix any errors. I think we can keep it for now and then we should open an issue if we want to keep using it.

Or we can decide that we don't want to spend time on this because it doesn't find any real issues.

Oh god now I know what's going on... it's for the mypy django-stubs thing... Yes, we need it for running mypy with Django. I think I spend 2 minutes to get it working. But I didn't actually fix any errors. I think we can keep it for now and then we should open an issue if we want to keep using it. Or we can decide that we don't want to spend time on this because it doesn't find any real issues.
Review

#37

https://git.data.coop/data.coop/membersystem/issues/37
"stripe~=10.5",
] ]
version = "0.0.1" version = "0.0.1"
@ -67,7 +68,7 @@ matrix.python.dependencies = [
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --cov=tests --cov=append {args}" cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --cov=tests --cov=append {args}"
no-cov = "cov --no-cov {args}" no-cov = "cov --no-cov {args}"
typecheck = "mypy --config-file=pyproject.toml ." typecheck = "mypy --config-file=pyproject.toml ."
# requirements = "pip-compile --output-file requirements/base.txt pyproject.toml" requirements = "pip-compile pyproject.toml"
benjaoming marked this conversation as resolved Outdated

Isn't this the correct way @valberg ?

Isn't this the correct way @valberg ?

Yeah the one being removed is the "correct" way which I found at https://github.com/juftin/hatch-pip-compile/blob/main/docs/upgrading.md

Yeah the one being removed is the "correct" way which I found at https://github.com/juftin/hatch-pip-compile/blob/main/docs/upgrading.md

I get this error when running it: LockFileError: Could not find lock file python version

image
I get this error when running it: `LockFileError: Could not find lock file python version` <img width="687" alt="image" src="/attachments/26d96dfc-0f57-4606-b140-f8d10be6aea4">
132 KiB

Maybe that error is because the old "requirements.txt" I had didn't specify the Python version using the same string pattern 🤪

Notably when this was changed, the command started working:

-# This file is autogenerated by pip-compile with Python 3.12
-# by the following command:
+# This file is autogenerated by hatch-pip-compile with Python 3.12

After that, it started working.

Maybe that error is because the old "requirements.txt" I had didn't specify the Python version using the same string pattern 🤪 Notably when this was changed, the command started working: ``` -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: +# This file is autogenerated by hatch-pip-compile with Python 3.12 ``` After that, it started working.

I've restored it... hatch env run --env default -- python --version; hatch env run --env dev -- python --version is really incomprehensible compared to the old version, also funny that hatch run dev:requirements spawns another hatch command in another environment - but I guess that it's just part of some magic that Just Works.

I've restored it... `hatch env run --env default -- python --version; hatch env run --env dev -- python --version` is really incomprehensible compared to the old version, also funny that `hatch run dev:requirements` spawns another hatch command in another environment - but I guess that it's just part of some magic that Just Works.
server = "./src/manage.py runserver 0.0.0.0:8000" server = "./src/manage.py runserver 0.0.0.0:8000"
migrate = "./src/manage.py migrate" migrate = "./src/manage.py migrate"
makemigrations = "./src/manage.py makemigrations" makemigrations = "./src/manage.py makemigrations"

View file

@ -1,19 +1,9 @@
# #
# This file is autogenerated by hatch-pip-compile with Python 3.12 # This file is autogenerated by pip-compile with Python 3.12
# by the following command:
# #
# - django-allauth==0.63.6 # pip-compile pyproject.toml
# - django-money==3.5.2
# - django-oauth-toolkit==2.4.0
# - django-registries==0.0.3
# - django-view-decorator==0.0.4
# - django-zen-queries==2.1.0
# - django<5.2,>=5.1b1
# - environs[django]==11.0.0
# - psycopg[binary]==3.2.1
# - uvicorn==0.30.1
# - whitenoise==6.7.0
# #
asgiref==3.8.1 asgiref==3.8.1
# via django # via django
babel==2.15.0 babel==2.15.0
@ -34,30 +24,35 @@ dj-email-url==1.0.6
# via environs # via environs
django==5.1b1 django==5.1b1
# via # via
# hatch.envs.default
# dj-database-url # dj-database-url
# django-allauth # django-allauth
# django-money # django-money
# django-oauth-toolkit # django-oauth-toolkit
# django-registries # django-registries
# django-stubs-ext
# django-view-decorator # django-view-decorator
# django-zen-queries # django-zen-queries
# membersystem (pyproject.toml)
django-allauth==0.63.6 django-allauth==0.63.6
# via hatch.envs.default # via membersystem (pyproject.toml)
django-cache-url==3.4.5 django-cache-url==3.4.5
# via environs # via environs
django-money==3.5.2 django-money==3.5.2
# via hatch.envs.default # via membersystem (pyproject.toml)
django-oauth-toolkit==2.4.0 django-oauth-toolkit==2.4.0
# via hatch.envs.default # via membersystem (pyproject.toml)
django-registries==0.0.3 django-registries==0.0.3
# via hatch.envs.default # via membersystem (pyproject.toml)
django-stubs-ext==5.0.4
# via membersystem (pyproject.toml)
django-view-decorator==0.0.4 django-view-decorator==0.0.4
# via hatch.envs.default # via membersystem (pyproject.toml)
django-zen-queries==2.1.0 django-zen-queries==2.1.0
# via hatch.envs.default # via membersystem (pyproject.toml)
environs==11.0.0 environs[django]==11.0.0
# via hatch.envs.default # via
# environs
# membersystem (pyproject.toml)
h11==0.14.0 h11==0.14.0
# via uvicorn # via uvicorn
idna==3.7 idna==3.7
@ -70,8 +65,10 @@ oauthlib==3.2.2
# via django-oauth-toolkit # via django-oauth-toolkit
packaging==24.1 packaging==24.1
# via marshmallow # via marshmallow
psycopg==3.2.1 psycopg[binary]==3.2.1
# via hatch.envs.default # via
# membersystem (pyproject.toml)
# psycopg
psycopg-binary==3.2.1 psycopg-binary==3.2.1
# via psycopg # via psycopg
py-moneyed==3.0 py-moneyed==3.0
@ -83,21 +80,27 @@ python-dotenv==1.0.1
pytz==2024.1 pytz==2024.1
# via django-oauth-toolkit # via django-oauth-toolkit
requests==2.32.3 requests==2.32.3
# via django-oauth-toolkit # via
# django-oauth-toolkit
# stripe
sqlparse==0.5.1 sqlparse==0.5.1
# via django # via django
stripe==10.5.0
# via membersystem (pyproject.toml)
typing-extensions==4.12.2 typing-extensions==4.12.2
# via # via
# dj-database-url # dj-database-url
# django-stubs-ext
# jwcrypto # jwcrypto
# psycopg # psycopg
# py-moneyed # py-moneyed
# stripe
urllib3==2.2.2 urllib3==2.2.2
# via requests # via requests
uvicorn==0.30.1 uvicorn==0.30.1
# via hatch.envs.default # via membersystem (pyproject.toml)
whitenoise==6.7.0 whitenoise==6.7.0
# via hatch.envs.default # via membersystem (pyproject.toml)
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# setuptools # setuptools

View file

@ -15,11 +15,13 @@
# - django-money==3.5.2 # - django-money==3.5.2
# - django-oauth-toolkit==2.4.0 # - django-oauth-toolkit==2.4.0
# - django-registries==0.0.3 # - django-registries==0.0.3
# - django-stubs-ext~=5.0
# - django-view-decorator==0.0.4 # - django-view-decorator==0.0.4
# - django-zen-queries==2.1.0 # - django-zen-queries==2.1.0
# - django<5.2,>=5.1b1 # - django<5.2,>=5.1b1
# - environs[django]==11.0.0 # - environs[django]==11.0.0
# - psycopg[binary]==3.2.1 # - psycopg[binary]==3.2.1
# - stripe~=10.5
# - uvicorn==0.30.1 # - uvicorn==0.30.1
# - whitenoise==6.7.0 # - whitenoise==6.7.0
# #
@ -45,6 +47,7 @@ click==8.1.7
coverage==7.3.0 coverage==7.3.0
# via # via
# hatch.envs.dev # hatch.envs.dev
# coverage
# pytest-cov # pytest-cov
cryptography==42.0.8 cryptography==42.0.8
# via jwcrypto # via jwcrypto
@ -84,13 +87,17 @@ django-registries==0.0.3
django-stubs==1.16.0 django-stubs==1.16.0
# via hatch.envs.dev # via hatch.envs.dev
django-stubs-ext==5.0.2 django-stubs-ext==5.0.2
# via django-stubs # via
# hatch.envs.dev
# django-stubs
django-view-decorator==0.0.4 django-view-decorator==0.0.4
# via hatch.envs.dev # via hatch.envs.dev
django-zen-queries==2.1.0 django-zen-queries==2.1.0
# via hatch.envs.dev # via hatch.envs.dev
environs==11.0.0 environs==11.0.0
# via hatch.envs.dev # via
# hatch.envs.dev
# environs
h11==0.14.0 h11==0.14.0
# via uvicorn # via uvicorn
idna==3.7 idna==3.7
@ -121,7 +128,9 @@ pip-tools==7.3.0
pluggy==1.5.0 pluggy==1.5.0
# via pytest # via pytest
psycopg==3.2.1 psycopg==3.2.1
# via hatch.envs.dev # via
# hatch.envs.dev
# psycopg
psycopg-binary==3.2.1 psycopg-binary==3.2.1
# via psycopg # via psycopg
py-moneyed==3.0 py-moneyed==3.0
@ -144,11 +153,15 @@ python-dotenv==1.0.1
pytz==2024.1 pytz==2024.1
# via django-oauth-toolkit # via django-oauth-toolkit
requests==2.32.3 requests==2.32.3
# via django-oauth-toolkit # via
# django-oauth-toolkit
# stripe
sqlparse==0.5.1 sqlparse==0.5.1
# via # via
# django # django
# django-debug-toolbar # django-debug-toolbar
stripe==10.5.0
# via hatch.envs.dev
tomli==2.0.1 tomli==2.0.1
# via django-stubs # via django-stubs
types-pytz==2024.1.0.20240417 types-pytz==2024.1.0.20240417
@ -164,6 +177,7 @@ typing-extensions==4.12.2
# mypy # mypy
# psycopg # psycopg
# py-moneyed # py-moneyed
# stripe
urllib3==2.2.2 urllib3==2.2.2
# via requests # via requests
uvicorn==0.30.1 uvicorn==0.30.1