diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed055722b64..ee4e7360c6c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,6 +42,8 @@ jobs: shell: bash steps: - uses: actions/checkout@v2 + with: + path: poetry - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 @@ -76,21 +78,27 @@ jobs: - name: Ensure cache is healthy if: steps.cache.outputs.cache-hit == 'true' + working-directory: ./poetry run: timeout 10s poetry run pip --version || rm -rf .venv - name: Install dependencies + working-directory: ./poetry run: poetry install - name: Run mypy + working-directory: ./poetry run: poetry run mypy - name: Install pytest plugin + working-directory: ./poetry run: poetry run pip install pytest-github-actions-annotate-failures - name: Run pytest + working-directory: ./poetry run: poetry run python -m pytest -n auto -p no:sugar -q tests/ - name: Run pytest (integration suite) + working-directory: ./poetry env: POETRY_TEST_INTEGRATION_GIT_USERNAME: ${GITHUB_ACTOR} POETRY_TEST_INTEGRATION_GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }} @@ -99,8 +107,9 @@ jobs: - name: Get Plugin Version (poetry-plugin-export) id: poetry-plugin-export-version run: | - echo ::set-output name=version::$(\ - poetry show poetry-plugin-export | grep version | cut -d : -f 2 | xargs) + PLUGIN_VERSION=$(curl -s https://pypi.org/pypi/poetry-plugin-export/json | python -c 'import json, sys ; print(json.load(sys.stdin)["info"]["version"])') + echo "Found version ${PLUGIN_VERSION}" + echo ::set-output name=version::${PLUGIN_VERSION} - name: Checkout Plugin Source (poetry-plugin-export) uses: actions/checkout@v2 @@ -109,10 +118,26 @@ jobs: repository: python-poetry/poetry-plugin-export ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.version }} + - name: Update poetry version (poetry-plugin-export) + working-directory: poetry-plugin-export + run: | + poetry add --lock --dev ../poetry + git diff + + - name: Install (poetry-plugin-export) + working-directory: ./poetry-plugin-export + run: poetry install + - name: Run pytest (poetry-plugin-export) - run: poetry run python -m pytest -p no:sugar -q poetry-plugin-export/tests/ + working-directory: ./poetry-plugin-export + run: poetry run python -m pytest -p no:sugar -q tests/ - name: Check for clean working tree + working-directory: ./poetry + run: git diff --exit-code --stat HEAD + + - name: Check for clean working tree (poetry-plugin-export) + working-directory: ./poetry-plugin-export run: | + git checkout -- pyproject.toml poetry.lock git diff --exit-code --stat HEAD - git -C poetry-plugin-export diff --exit-code --stat HEAD diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d2662b8a420..7e4bc029d3c 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -14,13 +14,3 @@ language: python language_version: python3 pass_filenames: false - -- id: poetry-export - name: poetry-export - description: run poetry export to sync lock file with requirements.txt - entry: poetry export - language: python - language_version: python3 - pass_filenames: false - files: ^poetry.lock$ - args: ["-f", "requirements.txt", "-o", "requirements.txt"] diff --git a/docs/pre-commit-hooks.md b/docs/pre-commit-hooks.md index a032c10e6cd..59f6e803157 100644 --- a/docs/pre-commit-hooks.md +++ b/docs/pre-commit-hooks.md @@ -53,6 +53,8 @@ The `poetry-export` hook calls the `poetry export` command to sync your `requirements.txt` file with your current dependencies. {{% note %}} +This hook is provided by the [Export Poetry Plugin](https://github.com/python-poetry/poetry-plugin-export). + It is recommended to run the [`poetry-lock`](#poetry-lock) hook prior to this one. {{% /note %}} diff --git a/poetry.lock b/poetry.lock index 17d1d118c3c..0fb5257d12b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -453,17 +453,6 @@ python-versions = ">=3.7,<4.0" [package.dependencies] importlib-metadata = {version = ">=1.7.0", markers = "python_version < \"3.8\""} -[[package]] -name = "poetry-plugin-export" -version = "1.0.5" -description = "Poetry plugin to export the dependencies to various formats" -category = "main" -optional = false -python-versions = ">=3.7,<4.0" - -[package.dependencies] -poetry = ">=1.2.0b1dev0,<2.0.0" - [[package]] name = "pre-commit" version = "2.19.0" @@ -887,7 +876,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "9f6938a60e25fe99bbed6db53e34edac39379a93fb12468c527706fc740bd4f2" +content-hash = "7003332690eee0c10ffcae8c137f1d7529d889a04c0916f13bda39a79acd5077" [metadata.files] atomicwrites = [ @@ -1241,10 +1230,6 @@ poetry-core = [ {file = "poetry-core-1.1.0b3.tar.gz", hash = "sha256:ea257bb0aab15008d1680cc221a46f3457a3b36f3d463736f552497f0b6b9350"}, {file = "poetry_core-1.1.0b3-py3-none-any.whl", hash = "sha256:2b65b697e22fc6fc9b60afcadfd4421db796d30d558a003654b5e67e3b262eaa"}, ] -poetry-plugin-export = [ - {file = "poetry-plugin-export-1.0.5.tar.gz", hash = "sha256:e7796292eaafac1316149f3a8070923c2a2214c98d046de1246b4d8eb0b0c84b"}, - {file = "poetry_plugin_export-1.0.5-py3-none-any.whl", hash = "sha256:925088b27c5747c3e0d8cc2bbb692a533eb4569874a676ac0d0f5ab237b15aaa"}, -] pre-commit = [ {file = "pre_commit-2.19.0-py2.py3-none-any.whl", hash = "sha256:10c62741aa5704faea2ad69cb550ca78082efe5697d6f04e5710c3c229afdd10"}, {file = "pre_commit-2.19.0.tar.gz", hash = "sha256:4233a1e38621c87d9dda9808c6606d7e7ba0e087cd56d3fe03202a01d2919615"}, diff --git a/pyproject.toml b/pyproject.toml index af1f004b8ed..afb79f05968 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ generate-setup-file = false python = "^3.7" poetry-core = "^1.1.0b3" -poetry-plugin-export = "^1.0.5" cachecontrol = { version = "^0.12.9", extras = ["filecache"] } cachy = "^0.3.0" cleo = "^1.0.0a5"