diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edbce9c051..ce6bba03fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,39 @@ name: Test overpass-api-python-wrapper -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: - build: + test: runs-on: ubuntu-latest + strategy: max-parallel: 5 matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - sudo apt-get install libgeos-dev - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: tox \ No newline at end of file + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + + - name: Install system dependencies + run: sudo apt-get install -y libgeos-dev + + - name: Install project dependencies + run: poetry install --no-root --sync + + - name: Run tests with tox + run: poetry run tox diff --git a/.gitignore b/.gitignore index 3d2579d726..c276c9cc6a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ pip-log.txt docs/_build/ Pipfile.lock venv/ +.tox diff --git a/poetry.lock b/poetry.lock index 4a6f024dec..2cde21fd88 100644 --- a/poetry.lock +++ b/poetry.lock @@ -568,4 +568,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.0" python-versions = ">3.9, <3.12" -content-hash = "4b325c8754e816798f6bb9667fbd2c1a2e9b78ce0e5c3819e22ec1dd8c62e862" +content-hash = "cbde58fd145ca379e13dd16d277aa51a4bebe0eb205fb9e55909cf7ddad3b2cf" diff --git a/pyproject.toml b/pyproject.toml index bc2921dac7..0ac1685a41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,15 +13,13 @@ python = ">3.9, <3.12" osm2geojson = "^0.2.5" requests = "^2.32.3" -[tool.poetry.dev-dependencies] -pytest = "^7.4.0" -tox = "^4.6.3" - [tool.poetry.group.dev.dependencies] +pytest = "^7.4.0" geojson = "^3.1.0" -requests-mock = {extras = ["fixtures"], version = "^1.12.1"} +requests-mock = { extras = ["fixtures"], version = "^1.12.1" } deepdiff = "^7.0.1" +tox = "^4.17.1" [build-system] -requires = ["poetry-core"] +requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 52a31908a6..0000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest>=7.4.0 -requests-mock[fixture] -tox>=4.6.3 -geojson>=1.3.1 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6a05501a0c..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -osm2geojson>=0.1.30 -requests>=2.31.0 diff --git a/tox.ini b/tox.ini index 235ed60c80..74c7ce7386 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,16 @@ [tox] -envlist = py{38,39,310,311} +envlist = py{39,310,311} skip_missing_interpreters = true [testenv] -deps = -r requirements-dev.txt -commands = python -m pytest +allowlist_externals = poetry +commands_pre = + poetry install --no-root --sync +commands = + poetry run pytest tests/ --import-mode importlib [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 \ No newline at end of file