Skip to content

Commit 4891403

Browse files
resolve conversation
1 parent 4c1dca6 commit 4891403

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162

163163
Build-Packages:
164164
name: Build Package Check
165-
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
165+
needs: [ Documentation, Lint, Type-Check, Security, Format ]
166166
runs-on: ubuntu-24.04
167167
permissions:
168168
contents: read
@@ -174,11 +174,11 @@ jobs:
174174
uses: ./.github/actions/python-environment
175175

176176
- name: Run Distribution Check
177-
run: poetry run -- nox -s lint:build-packages
177+
run: poetry run -- nox -s package:check
178178

179179
Tests:
180180
name: Unit-Tests (Python-${{ matrix.python-version }})
181-
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix , Build-Packages]
181+
needs: [ Build-Packages ]
182182
runs-on: ubuntu-24.04
183183
permissions:
184184
contents: read

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Your one-stop solution for managing all standard tasks and core workflows of you
4747
🔌️ Prerequisites
4848
-----------------
4949

50-
- `Python <https://www.python.org/`__ >= 3.9
50+
- `Python <https://www.python.org/>`__ >= 3.9
5151

5252
💾 Installation
5353
---------------

doc/changes/unreleased.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ PROJECT_CONFIG = Config(python_versions=(...), exasol_versions=(...), create_maj
2929

3030
* #465: Created BaseConfig class to better synchronize attributes needed for the PTB's
3131
growing functionalities
32-
* #494: Created check of built packages with nox session ``package:check``:
32+
* #494: Created check of built packages with nox session `package:check`

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162

163163
Build-Packages:
164164
name: Build Package Check
165-
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
165+
needs: [ Documentation, Lint, Type-Check, Security, Format ]
166166
runs-on: ubuntu-24.04
167167
permissions:
168168
contents: read
@@ -174,11 +174,11 @@ jobs:
174174
uses: exasol/python-toolbox/.github/actions/python-environment@v1
175175

176176
- name: Run Distribution Check
177-
run: poetry run -- nox -s lint:build-packages
177+
run: poetry run -- nox -s package:check
178178

179179
Tests:
180180
name: Unit-Tests (Python-${{ matrix.python-version }})
181-
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix, Build-Packages ]
181+
needs: [ Build-Packages ]
182182
runs-on: ubuntu-24.04
183183
permissions:
184184
contents: read
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import pytest
1+
import shutil
2+
from pathlib import Path
23
from unittest.mock import (
34
MagicMock,
45
patch,
56
)
7+
8+
import pytest
69
from nox.command import CommandFailed
7-
import shutil
8-
from pathlib import Path
910

10-
from exasol.toolbox.nox._package import package_check, PROJECT_CONFIG
1111
from exasol.toolbox.config import BaseConfig
12+
from exasol.toolbox.nox._package import (
13+
PROJECT_CONFIG,
14+
package_check,
15+
)
16+
1217

1318
class TestDistributionCheck:
1419
@staticmethod
@@ -17,23 +22,23 @@ def test_works_as_expected(nox_session):
1722

1823
@staticmethod
1924
def test_raises_non_zero_exist_with_readme_error(nox_session, tmp_path):
20-
# TODOs
21-
# 1. copy package files to a temp directory
22-
# 2. mock/alter the path for the function you need to use for testing
23-
# 3. modify rst file to have a broken link like is in this commit:
24-
# - `Python <https://www.python.org/`__ >= 3.9
2525
package = Path(tmp_path)
2626
package_readme = package / "README.rst"
27+
28+
# copy over `packages` and `include` from `pyproject.toml` to for `poetry build`
2729
shutil.copytree(PROJECT_CONFIG.root / "exasol", package / "exasol")
2830
shutil.copyfile(PROJECT_CONFIG.root / "README.rst", package_readme)
2931
shutil.copytree(PROJECT_CONFIG.root / "doc/changes", package / "doc/changes")
3032
shutil.copyfile(PROJECT_CONFIG.root / "LICENSE", package / "LICENSE")
31-
shutil.copyfile(PROJECT_CONFIG.root / "pyproject.toml", package / "pyproject.toml")
32-
old = "- `Python <https://www.python.org/>`__ >= 3.9"
33-
error = "- `Python <https://www.python.org/>`__ >= 3.9"
34-
readme = package_readme.read_text().splitlines()
35-
error_readme = [error if old in line else line for line in readme]
36-
package_readme.write_text("/n".join(error_readme))
33+
shutil.copyfile(
34+
PROJECT_CONFIG.root / "pyproject.toml", package / "pyproject.toml"
35+
)
36+
37+
# create an error in readme.rst
38+
not_closed_link_error = "- `Python <https://www.python.org/`__ >= 3.9"
39+
package_readme.open(mode="a").write(not_closed_link_error)
40+
41+
# use of the folder with errors in the nox -s package:check function
3742
config = BaseConfig()
3843
mock = MagicMock(spec=BaseConfig, wraps=config)
3944
mock.root = package
@@ -42,4 +47,4 @@ def test_raises_non_zero_exist_with_readme_error(nox_session, tmp_path):
4247
print(PROJECT_CONFIG.root)
4348
package_check(nox_session)
4449
# verify broken with non-zero exit status
45-
assert str(e.value) == "Returned code 1"
50+
assert str(e.value) == "Returned code 1"

0 commit comments

Comments
 (0)