Skip to content

Commit

Permalink
Merge pull request #18 from SvenMarcus/feature/pyproject
Browse files Browse the repository at this point in the history
Migrate to pyproject.toml
  • Loading branch information
markusweigelt authored Mar 22, 2023
2 parents 0b4b03b + 72e14f9 commit 615f171
Show file tree
Hide file tree
Showing 6 changed files with 1,040 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
authorized_keys
__pycache__/
.python-version
.pdm.toml
.pdm.lock
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ VOLUME /data
COPY init.sh /init.sh
COPY ocrdbrowser /usr/local/ocrd-monitor/ocrdbrowser
COPY ocrdmonitor /usr/local/ocrd-monitor/ocrdmonitor
COPY requirements.txt /usr/local/ocrd-monitor/requirements.txt
COPY pyproject.toml /usr/local/ocrd-monitor/pyproject.toml

RUN pip install -r /usr/local/ocrd-monitor/requirements.txt
RUN pip install /usr/local/ocrd-monitor

WORKDIR /
CMD ["/init.sh", "/data"]
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ You can then open `http://localhost:5000` in your browser (or the server host na
The tests are intended to be run outside of a container, as some of them will set up containers themselves.
Therefore you need to have a Python version >= 3.9 installed on your system.

1. Install runtime and dev dependencies
1. Install runtime and dev dependencies with `pip` or a project management tool like `pdm`

```bash
pip install -r requirements.txt
pip install -r requirements.dev.txt
pip install -e ".[dev]"
```

```bash
pdm install -G dev
```

2. Run nox or pytest
Expand Down
11 changes: 2 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,13 @@

@nox.session(python=("3.9", "3.10", "3.11"))
def mypy(session: nox.Session) -> None:
session.install("-r", "requirements.txt")
session.install("-r", "requirements.dev.txt")
session.install("mypy")
session.run(
"mypy", "--non-interactive", "--install-types", "ocrdbrowser", "ocrdmonitor"
)
session.install("-e", ".[dev]")
session.run("mypy", "--strict", "ocrdbrowser", "ocrdmonitor")


@nox.session(python=("3.9", "3.10", "3.11"))
def pytest(session: nox.Session) -> None:
session.install("-r", "requirements.txt")
session.install("-r", "requirements.dev.txt")
session.install("pytest")
session.install("-e", ".[dev]")
session.install("pytest-clarity")

session.run("pytest", "-vv", "tests")
Loading

0 comments on commit 615f171

Please sign in to comment.