• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

basilisp-lang / basilisp / 14563463011

20 Apr 2025 09:26PM UTC coverage: 98.496% (-0.2%) from 98.679%
14563463011

Pull #1243

github

web-flow
Merge 137f990be into 0fead055c
Pull Request #1243: Add a CLI subcommand to install Clojure Jar files in the virtualenv

1047 of 1060 branches covered (98.77%)

Branch coverage included in aggregate %.

13 of 28 new or added lines in 2 files covered. (46.43%)

8971 of 9111 relevant lines covered (98.46%)

0.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.32
/src/basilisp/contrib/jarutil.py
1
import shutil
1✔
2
from pathlib import Path
1✔
3
from tempfile import TemporaryDirectory
1✔
4
from zipfile import ZipFile
1✔
5

6

7
def install_jar(site_packages: Path, source_jar: Path) -> None:
1✔
NEW
8
    if source_jar.suffix != ".jar":
×
NEW
9
        raise ValueError(f"Expected a *.jar file; got *{source_jar.suffix}")
×
10

NEW
11
    with TemporaryDirectory() as tmpdir, ZipFile(source_jar, mode="r") as zf:
×
NEW
12
        zf.extractall(
×
13
            path=tmpdir,
14
            members=[mem for mem in zf.namelist() if not mem.startswith("META-INF")],
15
        )
NEW
16
        for p in Path(tmpdir).iterdir():
×
NEW
17
            if p.is_dir():
×
NEW
18
                destination = site_packages / p.name
×
NEW
19
                d = shutil.copytree(p, destination)
×
NEW
20
                print(f"Created {d}")
×
21
            else:
NEW
22
                f = shutil.copy(p, site_packages)
×
NEW
23
                print(f"Created {f}")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc