Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to pyproject.toml #18

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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