From bfcc54bbb98a1298d5ca55f781e315cd785b225a Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Lerman" Date: Tue, 17 Jan 2023 13:33:44 -0800 Subject: build: move to poetry for dependency management; consolidate more settings into pyproject.toml (#2187) Replaced setuptools with poetry which provides simpler dependency management, dependency locking and virtual environment management. This makes it easier for new developers to get a sane development environment (i.e. just `poetry install`) and also makes our CI pipeline more reproducable as now most development tools and libraries will only change through dependabot which will reduce the build failures on main and make breaking changes in dependencies more visible with dependabot PRs. Other changes: - moved isort, mypy and coverage config from setup.cfg to pyproject.toml - Changes in the generated rdflib wheel: - removed wheel extras related to development (i.e. `tests`, `docs`, `dev`) as poetry dependency groups should be used instead. - Added an extra group `lxml` with a dependency on lxml. - Added version ranges to dependencies, and tests to ensure these version ranges are valid. - Changes to tests: - Change pyparsing related tests so they work with older pyparsing. - Made the html5lib related tests conditional on html5lib existing. - Runtime changes: - Use importlib.metadata to set `__version__`. - Changed the devcontainer and related config to avoid contamination and interference with the host environment. Co-authored-by: Iwan Aucamp Co-authored-by: Edmond Chuc --- docker-compose.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'docker-compose.yml') diff --git a/docker-compose.yml b/docker-compose.yml index efe63700..c8c19e0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,22 +6,33 @@ services: context: . dockerfile: Dockerfile.devcontainer working_dir: /srv/workspace + environment: + - XDG_CACHE_HOME=/srv/workspace/.var/devcontainer/cache + - MYPY_CACHE_DIR=/srv/workspace/.var/devcontainer/mypy_cache + - TOX_WORK_DIR=/srv/workspace/.var/devcontainer/tox + - PYTEST_ADDOPTS=-o cache_dir=/srv/workspace/.var/devcontainer/pytest_cache + - PRE_COMMIT_HOME=/srv/workspace/.var/devcontainer/pre-commit volumes: - .:/srv/workspace:z,cached - - xdg-cache-home:/root/.cache - - dot-venv:/srv/workspace/.venv - - dot-tox:/srv/workspace/.tox - - dot-mypy-cache:/srv/workspace/.mypy_cache - - dot-pytest-cache:/srv/workspace/.pytest_cache command: - /bin/sh - -c - | echo Waiting for shutdown... override the command if this is not what you want. 1>&2 while sleep 1000; do :; done + run: + build: + context: . + dockerfile: Dockerfile.devcontainer + working_dir: /srv/workspace + environment: + - XDG_CACHE_HOME=/srv/workspace-var/cache + - MYPY_CACHE_DIR=/srv/workspace-var/mypy_cache + - TOX_WORK_DIR=/srv/workspace-var/tox + - PYTEST_ADDOPTS=-o cache_dir=/srv/workspace-var/pytest_cache + - PRE_COMMIT_HOME=/srv/workspace-var/pre-commit + volumes: + - .:/srv/workspace:z,cached + - workspace-var:/srv/workspace-var volumes: - xdg-cache-home: {} - dot-venv: {} - dot-tox: {} - dot-mypy-cache: {} - dot-pytest-cache: {} + workspace-var: {} -- cgit v1.2.1