Skip to content

Commit

Permalink
Refactor testing and migrate examples to src-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysle committed Nov 20, 2023
1 parent b0a98d0 commit 376982a
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 16 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: nox
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
nox:
strategy:
Expand All @@ -15,8 +20,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
- run: python3 --version && python --version
- run: pip install --upgrade pip setuptools
- run: pip install nox pytest virtualenv
- run: pip install -r requirements.txt pytest
- run: pytest . || true # See pytest's warnings
- run: nox --python ${{ matrix.python }}
# - run: nox --python ${{ matrix.python }} --report report.json && python report_to_table.py
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

HERE = os.path.abspath(os.path.dirname(__file__))

# -- REQUIRES: nox >= 2018.10.17
# SEE: https://nox.readthedocs.io/en/stable/index.html
# -- REQUIRES: nox >= 2023.04.22
# SEE: https://nox.thea.codes/en/stable/index.html
USE_PYTHON_VERSIONS_DEFAULT = ["3.8", "3.10", "3.12"]
USE_PYTHON_VERSIONS = os.environ.get("NOXFILE_PYTHON_VERSIONS", "").split()
if not USE_PYTHON_VERSIONS:
Expand All @@ -27,9 +27,8 @@

install_commands = (
('pip', 'install', '.'),
('pip', 'install', '-e', '.'),
('python', 'setup.py', 'install'),
('python', 'setup.py', 'develop'))
('pip', 'install', '-e', '.')
)


def install_packages(session, package_a, package_b, command_a, command_b):
Expand Down
4 changes: 2 additions & 2 deletions pkg_resources/pkg_a/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

license='Apache Software License',

packages=find_packages(),
namespace_packages=['example_pkg'],
packages=find_packages(where='src'),
package_dir={'': 'src'},
zip_safe=False,
)
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg_resources/pkg_b/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

license='Apache Software License',

packages=find_packages(),
namespace_packages=['example_pkg'],
packages=find_packages(where='src'),
package_dir={'': 'src'},
zip_safe=False,
)
File renamed without changes.
3 changes: 2 additions & 1 deletion pkgutil/pkg_a/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

license='Apache Software License',

packages=find_packages(),
packages=find_packages(where='src'),
package_dir={'': 'src'},
zip_safe=False,
)
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion pkgutil/pkg_b/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

license='Apache Software License',

packages=find_packages(),
packages=find_packages(where='src'),
package_dir={'': 'src'},
zip_safe=False,
)
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -- PYTHON PACKAGE REQUIREMENTS:
# USE: pip install -r <THIS_FILE>

setuptools
virtualenv
nox >= 2018.10.17
setuptools >= 68.2.2
nox >= 2023.04.22
7 changes: 7 additions & 0 deletions test/verify_packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from example_pkg import a
from example_pkg import b

print(a.name)
print(a.__path__)
print(b.name)
print(b.__path__)

0 comments on commit 376982a

Please sign in to comment.