Skip to content

Commit

Permalink
Merge pull request #197 from benjeffery/fix-codecov-again
Browse files Browse the repository at this point in the history
Fix codecov
  • Loading branch information
benjeffery authored Apr 5, 2024
2 parents 7c1eaa8 + 4b0ee05 commit dd693ed
Show file tree
Hide file tree
Showing 23 changed files with 106 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
jobs:
build:
docker:
- image: cimg/python:3.7
- image: cimg/python:3.8
steps:
- checkout
- run:
Expand Down
6 changes: 4 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ coverage:
project:
python:
target: 95%
flags: python
flags:
- python

patch:
python:
target: 90%
flags: python
flags:
- python
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.7, 3.11 ]
python: [ 3.8, 3.11 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
defaults:
run:
Expand Down
20 changes: 2 additions & 18 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9, "3.10", 3.11]
python: [3.8, 3.9, "3.10", 3.11]
wordsize: [64]
steps:
- name: Checkout
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9, "3.10", 3.11]
python: [3.8, 3.9, "3.10", 3.11]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -180,22 +180,6 @@ jobs:
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Run tests (3.7)
run: |
python -VV
# We install in this odd way to make sure we get both deps and a local kastore
pip install kastore --only-binary kastore -f python/dist/wheelhouse
pip uninstall -y kastore
pip install -v kastore --only-binary kastore -f python/dist/wheelhouse --no-index
python -c "import kastore"
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python
- name: Upload Wheels
uses: actions/upload-artifact@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ queue_rules:
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- status-success=Lint
- status-success=Python (3.7, macos-latest)
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.7, ubuntu-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.7, windows-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- "status-success=ci/circleci: build"

Expand All @@ -21,11 +21,11 @@ pull_request_rules:
- base=main
- label=AUTOMERGE-REQUESTED
- status-success=Lint
- status-success=Python (3.7, macos-latest)
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.7, ubuntu-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.7, windows-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- "status-success=ci/circleci: build"
actions:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand All @@ -13,29 +13,29 @@ repos:
- id: clang-format
verbose: true
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--application-directories=python,
--unclassifiable-application-module=_kastore]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py3-plus, --py37-plus]
args: [--py3-plus, --py38-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
args: [--config=python/.flake8]
additional_dependencies: ["flake8-bugbear==20.1.4", "flake8-builtins==1.5.2"]
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
7 changes: 7 additions & 0 deletions python/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
--------------------
[0.3.X] - 202X-XX-XX
--------------------

kastore now requires Python 3.8 or later.


--------------------
[0.3.2] - 2022-07-12
--------------------
Expand Down
6 changes: 3 additions & 3 deletions python/kastore/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
The CLI for kastore. Provides utilities for examining kastore files.
"""
import argparse
import logging
import os
Expand All @@ -10,6 +7,9 @@

import kastore

"""
The CLI for kastore. Provides utilities for examining kastore files.
"""

logger = logging.getLogger(__name__)

Expand Down
7 changes: 4 additions & 3 deletions python/kastore/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""
Exception definitions for kastore.
"""
from _kastore import FileFormatError
from _kastore import KastoreException
from _kastore import VersionTooNewError
from _kastore import VersionTooOldError

"""
Exception definitions for kastore.
"""

# Some exceptions are defined in the low-level module. In particular, the
# superclass of all exceptions for kastore is defined here. We define the
# docstrings here to avoid difficulties with compiling C code on
Expand Down
16 changes: 9 additions & 7 deletions python/kastore/store.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import logging
import os
import struct
from collections.abc import Mapping

import numpy as np

import kastore.exceptions as exceptions

"""
The Python engine for kastore.
Expand All @@ -14,14 +23,7 @@
+ 8 byte bounaries.
+===================================+
"""
import logging
import os
import struct
from collections.abc import Mapping

import numpy as np

import kastore.exceptions as exceptions

logger = logging.getLogger(__name__)

Expand Down
7 changes: 4 additions & 3 deletions python/make_standard_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Makes the files in the test-data directory.
"""
import os.path
import struct
import tempfile
Expand All @@ -10,6 +7,10 @@
import kastore as kas
import kastore.store as store

"""
Makes the files in the test-data directory.
"""


class MalformedFilesBuilder:
"""
Expand Down
2 changes: 2 additions & 0 deletions python/requirements/development.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
attrs
breathe==4.35.0
coverage
flake8
hypothesis
Expand All @@ -9,5 +10,6 @@ numpy
mock
pre-commit
breathe
Sphinx==5.3.0
sphinx_rtd_theme
sphinx-issues
3 changes: 1 addition & 2 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers =
Topic :: Scientific/Engineering :: Bio-Informatics
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand All @@ -36,7 +35,7 @@ platforms =

[options]
packages = kastore
python_requires = >=3.7
python_requires = >=3.8
include_package_data = True
install_requires =
numpy>=1.7
Expand Down
10 changes: 6 additions & 4 deletions python/stress_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
"""
Code to stress the low-level API as much as possible to expose
any memory leaks or error handling issues.
"""
import argparse
import os
import random
Expand All @@ -16,6 +12,12 @@
import tests.test_storage as test_storage


"""
Code to stress the low-level API as much as possible to expose
any memory leaks or error handling issues.
"""


def main():
modules = {
"errors": test_errors,
Expand Down
7 changes: 4 additions & 3 deletions python/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Test cases for the kastore CLI.
"""
import io
import logging
import os
Expand All @@ -16,6 +13,10 @@
import kastore.__main__ as main
import kastore.cli as cli

"""
Test cases for the kastore CLI.
"""


def capture_output(func, *args, **kwargs):
"""
Expand Down
7 changes: 4 additions & 3 deletions python/tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Tests for error conditions.
"""
import os
import platform
import struct
Expand All @@ -12,6 +9,10 @@
import kastore as kas
import kastore.store as store

"""
Tests for error conditions.
"""

IS_WINDOWS = platform.system() == "Windows"


Expand Down
15 changes: 11 additions & 4 deletions python/tests/test_file_format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Tests checking that the file format is as it should be.
"""
import os
import pathlib
import struct
Expand All @@ -14,10 +11,20 @@
import kastore as kas
import kastore.store as store

"""
Tests checking that the file format is as it should be.
"""

# Set the deadline to None to avoid weird behaviour on CI.
hypothesis.settings.register_profile("kastore_defaults", deadline=None)
hypothesis.settings.register_profile(
"kastore_defaults",
deadline=None,
# Supress warnings resultsing from inheritance
suppress_health_check=(hypothesis.HealthCheck.differing_executors,),
)
hypothesis.settings.load_profile("kastore_defaults")


# Exclude any 'other' unicode categories:
# http://www.unicode.org/reports/tr44/#General_Category_Values
key_alphabet = hst.characters(blacklist_categories=("C",))
Expand Down
7 changes: 4 additions & 3 deletions python/tests/test_fileobj.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Tests for load()ing and dump()ing with file-like objects.
"""
import multiprocessing
import os
import pathlib
Expand All @@ -17,6 +14,10 @@

import kastore as kas

"""
Tests for load()ing and dump()ing with file-like objects.
"""


IS_WINDOWS = platform.system() == "Windows"

Expand Down
7 changes: 4 additions & 3 deletions python/tests/test_interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""
Basic tests for the information API.
"""
import io
import os
import pathlib
Expand All @@ -12,6 +9,10 @@
import kastore as kas
import kastore.exceptions as exceptions

"""
Basic tests for the information API.
"""


class InterfaceTest(unittest.TestCase):
"""
Expand Down
Loading

0 comments on commit dd693ed

Please sign in to comment.