Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Jul 12, 2022
1 parent f086089 commit 933eabc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
with:
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: python -m pip install coverage
- run: python -m pip install --prefer-binary -e .[test]
- run: coverage run -m pytest
- uses: AndreMiras/coveralls-python-action@develop
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tests/__pycache__
.flag_filter_cache
.pytest_cache
py??
py???
.ci_bak
venv
.coverage
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools>=46.4.0",
"setuptools_scm[toml]>=3.4",
"cmake>=3.13"
]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ python_requires = >=3.6
[options.extras_require]
test =
pytest
pre-commit
pytest-cov
graphviz
particle
numpy
Expand Down
31 changes: 13 additions & 18 deletions src/pyhepmc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
try:
# make pyhepmc importable even if it is not installed yet for setup.cfg
from ._core import * # noqa
from ._io import ( # noqa
ReaderAscii,
ReaderAsciiHepMC2,
ReaderLHEF,
ReaderHEPEVT,
WriterAscii,
WriterAsciiHepMC2,
WriterHEPEVT,
fill_genevent_from_hepevt,
pyhepmc_open as open,
)
except ImportError: # pragma: no cover
pass # pragma: no cover

from ._version import version as __version__ # noqa
from ._core import * # noqa
from ._io import ( # noqa
ReaderAscii,
ReaderAsciiHepMC2,
ReaderLHEF,
ReaderHEPEVT,
WriterAscii,
WriterAsciiHepMC2,
WriterHEPEVT,
fill_genevent_from_hepevt,
pyhepmc_open as open,
)
from ._version import __version__ # noqa
2 changes: 1 addition & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_open(evt): # noqa
"writer", (hep.WriterAscii, hep.WriterAsciiHepMC2, hep.WriterHEPEVT)
)
def test_open_with_writer(evt, writer): # noqa
filename = "test_open_%s.dat" % writer.__name__
filename = f"test_open_{writer.__name__}.dat"
with writer(filename) as f:
f.write(evt)

Expand Down

0 comments on commit 933eabc

Please sign in to comment.