Skip to content

Commit

Permalink
Merge pull request #224 from openzim/expose_version
Browse files Browse the repository at this point in the history
Expose `constants.VERSION` to have access to zimscraperlib version from scrapers
  • Loading branch information
benoit74 authored Nov 29, 2024
2 parents 974ac37 + 995ab95 commit 5a002d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add `filesystem.validate_folder_writable` to check if a folder can be written to #200
- Expose `constants.VERSION` to have access to zimscraperlib version from scrapers #224

### Fixed

Expand Down
1 change: 1 addition & 0 deletions src/zimscraperlib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ROOT_DIR = pathlib.Path(__file__).parent
NAME = pathlib.Path(__file__).parent.name
SCRAPER = f"{NAME} {__version__}"
VERSION = __version__
CONTACT = "[email protected]"
DEFAULT_USER_AGENT = f"{NAME}/{__version__} ({CONTACT})"

Expand Down
13 changes: 13 additions & 0 deletions tests/test_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from zimscraperlib import constants


def test_name():
assert constants.NAME


def test_scraper():
assert constants.SCRAPER


def test_version():
assert constants.VERSION

0 comments on commit 5a002d2

Please sign in to comment.