Skip to content

Commit 551abcb

Browse files
committed
Merge branch 'release/0.16.4'
2 parents 1be338b + 0190020 commit 551abcb

6 files changed

Lines changed: 26 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
## [0.16.4] - 2026-06-09
10+
11+
### Changed
12+
- automatically remove old cache directories
13+
14+
### Fixed
15+
- adapted to a change in NCBI metadata (`ftp_path` now has a trailing slash)
16+
917
## [0.16.3] - 2025-09-30
1018

1119
### Changed
@@ -502,6 +510,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
502510
- Added `-r` and `--match/--no-match` option to select sequences by regex.
503511

504512
[Unreleased]: https://github.com/vanheeringen-lab/genomepy/compare/master...develop
513+
[0.16.4]: https://github.com/vanheeringen-lab/genomepy/compare/0.16.3...0.16.4
505514
[0.16.3]: https://github.com/vanheeringen-lab/genomepy/compare/0.16.2...0.16.3
506515
[0.16.2]: https://github.com/vanheeringen-lab/genomepy/compare/0.16.1...0.16.2
507516
[0.16.1]: https://github.com/vanheeringen-lab/genomepy/compare/0.16.0...0.16.1

docs/release_checklist.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
```shell
3232
pip install uv
3333
uv pip install hatch
34+
rm -rf dist
3435
hatch build -t wheel
3536
uv pip install --system dist/*.whl --force-reinstall
3637

genomepy/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Metadata"""
22

3-
__version__ = "0.16.3"
3+
__version__ = "0.16.4"
44
__author__ = (
55
"Siebren Frölich, Maarten van der Sande, Tilman Schäfers and Simon van Heeringen"
66
)

genomepy/caching.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ def _cast(var):
2525
cache_exp_other = _cast(config.get("cache_exp_other", 3.6e3))
2626
cache_exp_genomes = _cast(config.get("cache_exp_genomes", 6.048e5))
2727

28+
# remove old cache directories
29+
if os.path.exists(user_cache_dir("genomepy")):
30+
for version in os.listdir(user_cache_dir("genomepy")):
31+
genomepy_cache_dir = os.path.join(user_cache_dir("genomepy"), version)
32+
cache_age = time() - os.stat(genomepy_cache_dir).st_mtime
33+
if cache_age > cache_exp_genomes:
34+
rm_rf(genomepy_cache_dir)
35+
36+
# create a cache directory
2837
genomepy_cache_dir = os.path.join(user_cache_dir("genomepy"), __version__)
2938
os.makedirs(genomepy_cache_dir, exist_ok=True)
3039

genomepy/providers/ncbi.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,13 @@ def _ftp_or_html_link(self, name, file_suffix, skip_check=False):
192192
NCBI's files are accessible over FTP and HTTPS
193193
Try HTTPS first and return the first functioning link
194194
"""
195-
genome = self.genomes[safe(name)]
196-
ftp_link = genome["ftp_path"]
195+
ftp_link = self.genomes[safe(name)]["ftp_path"]
196+
# add a trailing slash, if missing
197+
if ftp_link[-1] != "/":
198+
ftp_link += "/"
197199
html_link = ftp_link.replace("ftp://", "https://")
198200
for link in [html_link, ftp_link]:
199-
link += "/" + link.split("/")[-1] + file_suffix
201+
link += link.split("/")[-2] + file_suffix
200202

201203
if skip_check or check_url(link, max_tries=2, timeout=10):
202204
return link

tests/test_13_annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_named_gtf():
111111
df = a.named_gtf
112112
assert df.index.name == "gene_name"
113113
assert str(a.gtf.index.dtype) == "int64"
114-
assert str(df.index.dtype) == "object"
114+
assert str(df.index.dtype) in ["object", "str"] # pandas v2 == object, v3 == str
115115
assert set(df.at["YDL248W", "seqname"]) == {"chrIV"}
116116

117117

0 commit comments

Comments
 (0)