From bb879cc660b116720d0653c859346f7a6ab98d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=20Vinh=20LUONG=20=28LU=CC=9BO=CC=9BNG=20The=CC=82?= =?UTF-8?q?=CC=81=20Vinh=29?= Date: Tue, 19 Dec 2023 18:12:02 -0800 Subject: [PATCH] update Poetry configs to avoid bugs on Windows caused by long Poetry-generated file/folder paths exceeding 260 chars --- .../workflows/install-lint-test-on-win.yml | 3 +++ .gitignore | 1 + make.bat | 21 ++++++++++++------- poetry.toml | 1 + requirements/docs.txt | 4 ---- requirements/lint.txt | 3 --- requirements/test.txt | 1 - 7 files changed, 19 insertions(+), 15 deletions(-) delete mode 100644 requirements/docs.txt delete mode 100644 requirements/lint.txt delete mode 100644 requirements/test.txt diff --git a/.github/workflows/install-lint-test-on-win.yml b/.github/workflows/install-lint-test-on-win.yml index 0c0457a22..e3073f126 100644 --- a/.github/workflows/install-lint-test-on-win.yml +++ b/.github/workflows/install-lint-test-on-win.yml @@ -28,6 +28,9 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install Poetry + run: .\make get-poetry + - name: Install Package & Dependencies run: .\make install diff --git a/.gitignore b/.gitignore index 10ec8dcbc..8289049d8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ poetry.lock __pycache__/ .pytest_cache/ .ropeproject/ +.venv/ # DOCUMENTATION diff --git a/make.bat b/make.bat index 4a9ba1c39..ec0b1c586 100644 --- a/make.bat +++ b/make.bat @@ -5,6 +5,8 @@ :: ======= SET TARGET=%1 +IF "%TARGET%"=="get-poetry" GOTO get-poetry + IF "%TARGET%"=="install" GOTO install IF "%TARGET%"=="lint" GOTO lint @@ -29,13 +31,18 @@ set DOCS_DIR=.\%DOCS_DIR_NAME% set DOCS_BUILD_DIR=%DOCS_DIR%\_build +:: POETRY +:: ====== +:get-poetry + python3 -m pip install Poetry --upgrade --user + GOTO end + + :: INSTALLATION :: ============ :install - :: package with main & contrib dependencies - python3 -m pip install -e ".[contrib]" --upgrade --user - :: extra developer dependencies - python3 -m pip install -r requirements/docs.txt -r requirements/lint.txt -r requirements/test.txt --upgrade --user + poetry lock + poetry install --extras=contrib --with=docs --with=lint --with=test GOTO end @@ -47,18 +54,18 @@ set DOCS_BUILD_DIR=%DOCS_DIR%\_build GOTO end :lint-flake8 - flake8 %LIB_DIR_NAME% %DOCS_DIR_NAME% %EXAMPLES_DIR_NAME% %TESTS_DIR_NAME% + poetry run flake8 %LIB_DIR_NAME% %DOCS_DIR_NAME% %EXAMPLES_DIR_NAME% %TESTS_DIR_NAME% GOTO end :lint-pylint - pylint %LIB_DIR_NAME% %DOCS_DIR_NAME% %EXAMPLES_DIR_NAME% %TESTS_DIR_NAME% + poetry run pylint %LIB_DIR_NAME% %DOCS_DIR_NAME% %EXAMPLES_DIR_NAME% %TESTS_DIR_NAME% GOTO end :: TESTING :: ======= :test - pytest + poetry run pytest GOTO end diff --git a/poetry.toml b/poetry.toml index 3b549d6c8..cfd152fd3 100644 --- a/poetry.toml +++ b/poetry.toml @@ -1,2 +1,3 @@ [virtualenvs] create = true +in-project = true # important on Windows to avoid path lengths exceeding default max length of 260 diff --git a/requirements/docs.txt b/requirements/docs.txt deleted file mode 100644 index 78269c72c..000000000 --- a/requirements/docs.txt +++ /dev/null @@ -1,4 +0,0 @@ -sphinx >= 7.2 -sphinx-autobuild >= 2021.3 -sphinx-press-theme >= 0.8 -myst-parser >= 2.0 diff --git a/requirements/lint.txt b/requirements/lint.txt deleted file mode 100644 index fd4ca35ab..000000000 --- a/requirements/lint.txt +++ /dev/null @@ -1,3 +0,0 @@ -flake8 >= 6.1 -pylint >= 3.0 -pydocstyle >= 6.3 diff --git a/requirements/test.txt b/requirements/test.txt deleted file mode 100644 index b044a7770..000000000 --- a/requirements/test.txt +++ /dev/null @@ -1 +0,0 @@ -pytest >= 7.4