Skip to content

Commit

Permalink
Merge pull request #218 from lephare-photoz/issue/215/extend-python-v…
Browse files Browse the repository at this point in the history
…ersion-coverage

Added 313 to PyPi publish
  • Loading branch information
raphaelshirley authored Oct 16, 2024
2 parents ee3a99c + 0123193 commit 8adf41f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
python_version: "3.12"
- os: ubuntu-22.04
python: 313
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
python_version: "3.13"

# MacOS x86_64
- os: macos-12
Expand All @@ -63,6 +68,10 @@ jobs:
python: 312
platform_id: macosx_x86_64
python_version: "3.12"
- os: macos-12
python: 313
platform_id: macosx_x86_64
python_version: "3.13"

# MacOS arm64
- os: macos-14
Expand All @@ -81,6 +90,10 @@ jobs:
python: 312
platform_id: macosx_arm64
python_version: "3.12"
- os: macos-14
python: 313
platform_id: macosx_arm64
python_version: "3.13"

steps:
- name: Checkout LePhare
Expand Down Expand Up @@ -114,7 +127,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules
submodules: recursive # Optional, use if you have submodules

- name: Build SDist
run: pipx run build --sdist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
INCLUDE_COVERAGE: TRUE
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Collect C++ coverage
run: |
lcov --output-file coverage.cpp --capture --directory build
lcov --output-file coverage.cpp --capture --directory build --rc geninfo_unexecuted_blocks=1 --ignore-errors mismatch,gcov
lcov --output-file coverage.cpp --extract coverage.cpp $PWD/src/"*"
cat coverage.lcov coverage.cpp > coverage.txt
Expand Down
11 changes: 10 additions & 1 deletion tests/lephare/test_data_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ def test_read_list_file_remote(mock_get):

def test_make_default_retriever(data_registry_file):
mock_registry_content = "file1.txt hash1\nfile2.txt hash2"
with patch("builtins.open", mock_open(read_data=mock_registry_content)):

# Create a mock_open instance
m_open = mock_open(read_data=mock_registry_content)

# Mock __enter__ and __exit__ for context management
m_open.return_value.__enter__ = lambda self: self
m_open.return_value.__exit__ = lambda self, exc_type, exc_val, exc_tb: None

# Patch the built-in open method with the mocked version
with patch("builtins.open", m_open):
retriever = make_default_retriever()
assert retriever.base_url == DEFAULT_BASE_DATA_URL
assert retriever.path == Path(DEFAULT_LOCAL_DATA_PATH)
Expand Down

0 comments on commit 8adf41f

Please sign in to comment.