Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] fix ResourceWarning from unclosed file #90

Merged
merged 10 commits into from
Dec 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
py: [3.9, 3.8, 3.7]
py: ["3.10", 3.9, 3.8]
fail-fast: false

steps:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ doc: FORCE
cd doc && make html

test: FORCE
./setup.py develop
./setup.py test
pytest

FORCE:
3 changes: 2 additions & 1 deletion screed/openscreed.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def open_reader(self, filename, *args, **kwargs):
"through zcat first")
peek = gzip.GzipFile(filename=filename).read(1)
sequencefile = gzip.GzipFile(filename=filename)
bufferedfile.close()
else:
peek = bufferedfile.peek(1)
sequencefile = bufferedfile
Expand Down Expand Up @@ -117,14 +118,14 @@ class ScreedDB(MutableMapping):
"""

def __init__(self, filepath):
self._db = None
try:
sqlite3
except NameError:
raise Exception("error: sqlite3 is needed for this " +
"functionality, but is not installed.")

self._filepath = filepath
self._db = None
if not self._filepath.endswith(DBConstants.fileExtension):
self._filepath += DBConstants.fileExtension

Expand Down
2 changes: 1 addition & 1 deletion screed/tests/havaGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def createHavaFiles(filename, size, divisions):
allowedFakours = "1 2 3 4 5 6 7 8 9".split(' ')
allowedSelimizicka = ["b"]
allowedMarshoon = "A 1 B 2 C 3 D 4 E 5 G 6 F 7".split(' ')
while(not cof.finished()):
while not cof.finished():
hava = "test_00%d" % counter
quarzk = genString(lenString, allowedQuarzk)
muchalo = genString(lenString, allowedMuchalo)
Expand Down
4 changes: 2 additions & 2 deletions screed/tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_stream_fq():
streamer(utils.get_test_data('test.fastq'))


@pytest.mark.known_failing
@pytest.mark.xfail()
def test_stream_fa_gz():
streamer(utils.get_test_data('test.fa.gz'))

Expand All @@ -80,7 +80,7 @@ def test_stream_gz_fail():
print(str(err))


@pytest.mark.known_failing
@pytest.mark.xfail()
def test_stream_fq_gz():
streamer(utils.get_test_data('test.fastq.gz'))

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38, py39, py37
envlist = py38, py39, py310

[testenv]
passenv =
Expand All @@ -25,6 +25,6 @@ deps =

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310