Skip to content

Commit

Permalink
Move code to toplevel pretix_ldap/ and tests to toplevel tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohalt committed Apr 15, 2024
1 parent 9458554 commit cafd70d
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 19 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ __pycache__/
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
Expand Down
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

17 changes: 12 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,24 @@ Development setup
Running CI linter and tests locally
-----------------------------------

1. [Install nix](https://github.com/DeterminateSystems/nix-installer)
1. `Install nix`_

2. Enter devshell: `nix develop`

3. Run linter::
3. Build package::

python -m build

4. Run linter::

cd src/
flake8

4. Run tests::
5. Run tests::

cp -r dist tests

cd tests

cd src/tests
pytest


Expand All @@ -98,3 +104,4 @@ Released under the terms of the Apache License 2.0

.. _pretix: https://github.com/pretix/pretix
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
.. _Install nix: https://github.com/DeterminateSystems/nix-installer
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/setup.py → setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

try:
with open(
os.path.join(os.path.dirname(__file__), "../README.rst"), encoding="utf-8"
os.path.join(os.path.dirname(__file__), "README.rst"), encoding="utf-8"
) as f:
long_description = f.read()
except: # NOQA
Expand Down
9 changes: 9 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM docker.io/pretix/standalone:stable
USER root
WORKDIR /pretix-ldap/
COPY dist/pretix_ldap*.whl .
RUN PYTHONPATH=$PYTHONPATH:/pretix/src pip3 install pretix_ldap*.whl
USER pretixuser
RUN cd /pretix/src && make production


2 changes: 1 addition & 1 deletion src/tests/docker-compose.yml → tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
container_name: redis

pretix:
build: ./../..
build: ./.
container_name: pretix
volumes:
- ./pretix/etc/pretix:/etc/pretix
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/tests/test_pretix-ldap.py → tests/test_pretix-ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@

@pytest.fixture(scope="module")
def start_pretix():
import os

print(os.getcwd())
print(os.system("ls"))
print("start pretix")
subprocess.Popen(["podman-compose", "up"])
print("started pretix")
yield
print("stop pretix")
subprocess.run(["podman-compose", "down"])
print("stopped pretix")


@pytest.fixture(scope="module")
Expand Down

0 comments on commit cafd70d

Please sign in to comment.