Skip to content

Commit

Permalink
Merge pull request #94 from aitomatic/dev
Browse files Browse the repository at this point in the history
update Poetry configs to avoid bugs on Windows caused by long Poetry-generated file/folder paths exceeding 260 chars
  • Loading branch information
TheVinhLuong102 authored Dec 20, 2023
2 parents 8dee41b + bb879cc commit 2903c65
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/install-lint-test-on-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ poetry.lock
__pycache__/
.pytest_cache/
.ropeproject/
.venv/


# DOCUMENTATION
Expand Down
21 changes: 14 additions & 7 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:: =======
SET TARGET=%1

IF "%TARGET%"=="get-poetry" GOTO get-poetry

IF "%TARGET%"=="install" GOTO install

IF "%TARGET%"=="lint" GOTO lint
Expand All @@ -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


Expand All @@ -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


Expand Down
1 change: 1 addition & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[virtualenvs]
create = true
in-project = true # important on Windows to avoid path lengths exceeding default max length of 260
4 changes: 0 additions & 4 deletions requirements/docs.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements/lint.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements/test.txt

This file was deleted.

0 comments on commit 2903c65

Please sign in to comment.