[med-svn] [Git][med-team/python-etelemetry][upstream] New upstream version 0.3.1
Lance Lin (@linqigang)
gitlab at salsa.debian.org
Thu Nov 16 16:51:05 GMT 2023
Lance Lin pushed to branch upstream at Debian Med / python-etelemetry
Commits:
391f0295 by Lance Lin at 2023-11-16T20:27:57+07:00
New upstream version 0.3.1
- - - - -
5 changed files:
- .github/workflows/pythonpackage.yml
- etelemetry/_version.py
- etelemetry/client.py
- etelemetry/tests/test_client.py
- setup.cfg
Changes:
=====================================
.github/workflows/pythonpackage.yml
=====================================
@@ -14,6 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
+ fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
@@ -31,10 +32,10 @@ jobs:
- name: Test with pytest
run: |
pytest -vs --cov ./ --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules etelemetry
- - uses: codecov/codecov-action at v1
+ - uses: codecov/codecov-action at v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./cov.xml # optional
flags: unittests # optional
name: codecov-et # optional
- fail_ci_if_error: true # optional (default = false)
\ No newline at end of file
+ fail_ci_if_error: false
=====================================
etelemetry/_version.py
=====================================
@@ -24,9 +24,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> master, tag: v0.3.0)"
- git_full = "546f6ad780c09de0e3258b07085c223883bdb6ac"
- git_date = "2022-01-12 14:52:55 -0500"
+ git_refnames = " (tag: v0.3.1)"
+ git_full = "5bdab69f63d7bc643f6e6c73d5eb78eaf2d6a21d"
+ git_date = "2023-10-13 11:10:57 -0400"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
etelemetry/client.py
=====================================
@@ -1,4 +1,5 @@
import os
+from packaging.version import Version
try:
import ci_info
@@ -92,8 +93,6 @@ def check_available_version(project, version, lgr=None, raise_exception=False):
import logging
lgr = logging.getLogger('et-client')
- from pkg_resources import parse_version
-
latest = {"version": "Unknown", "bad_versions": []}
ret = None
try:
@@ -104,8 +103,8 @@ def check_available_version(project, version, lgr=None, raise_exception=False):
finally:
if ret:
latest.update(**ret)
- local_version = parse_version(version)
- remote_version = parse_version(latest["version"])
+ local_version = Version(version)
+ remote_version = Version(latest["version"])
if local_version < remote_version:
lgr.warning("A newer version (%s) of %s is available. You are "
"using %s", latest["version"], project, version)
@@ -118,7 +117,7 @@ def check_available_version(project, version, lgr=None, raise_exception=False):
version, project)
if latest["bad_versions"] and any(
[
- local_version == parse_version(ver)
+ local_version == Version(ver)
for ver in latest["bad_versions"]
]
):
=====================================
etelemetry/tests/test_client.py
=====================================
@@ -4,6 +4,20 @@ from ..config import ET_ROOT
from ..client import _etrequest, get_project, check_available_version
+def check_cxn(scope="session"):
+ import requests
+
+ try:
+ requests.get("http://example.com")
+ return True
+ except Exception:
+ return False
+
+
+no_cxn = check_cxn() is False
+
+
+ at pytest.mark.skipif(no_cxn, reason="No connection")
def test_etrequest():
endpoint = "http://fakeendpoint/"
with pytest.raises(RuntimeError):
@@ -16,6 +30,7 @@ def test_etrequest():
assert _etrequest(endpoint)
+ at pytest.mark.skipif(no_cxn, reason="No connection")
def test_get_project():
repo = "invalidrepo"
with pytest.raises(ValueError):
@@ -27,8 +42,9 @@ def test_get_project():
def test_noet():
import os
+
old_var = None
- if 'NO_ET' in os.environ:
+ if "NO_ET" in os.environ:
old_var = (True, os.environ["NO_ET"])
os.environ["NO_ET"] = "1"
repo = "github/hub"
@@ -40,6 +56,7 @@ def test_noet():
os.environ["NO_ET"] = old_var[1]
+ at pytest.mark.skipif(no_cxn, reason="No connection")
def test_check_available():
repo = "invalidrepo"
res = check_available_version(repo, "0.1.0")
=====================================
setup.cfg
=====================================
@@ -21,6 +21,7 @@ classifiers =
[options]
python_requires = >= 3.7
install_requires =
+ packaging
requests
ci-info >= 0.2
test_requires =
View it on GitLab: https://salsa.debian.org/med-team/python-etelemetry/-/commit/391f029524bbb3751af6afcd2c715c038bfe8a51
--
View it on GitLab: https://salsa.debian.org/med-team/python-etelemetry/-/commit/391f029524bbb3751af6afcd2c715c038bfe8a51
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231116/ef68d2a3/attachment-0001.htm>
More information about the debian-med-commit
mailing list