Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-watermark for openSUSE:Factory checked in at 2023-07-04 15:22:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-watermark (Old) and /work/SRC/openSUSE:Factory/.python-watermark.new.23466 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-watermark" Tue Jul 4 15:22:02 2023 rev:8 rq:1096410 version:2.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-watermark/python-watermark.changes 2022-06-05 21:28:49.109069624 +0200 +++ /work/SRC/openSUSE:Factory/.python-watermark.new.23466/python-watermark.changes 2023-07-04 15:22:29.486245832 +0200 @@ -1,0 +2,17 @@ +Sun Jul 2 15:02:31 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Update to 2.4.3 + * Make py3nvml installation for GPU info optional. + (replaces watermark-pr92-optional-py3nvml.patch) + +------------------------------------------------------------------- +Fri Jun 2 13:14:54 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Update to 2.4.2 + * Adds a new --gpu flag to print out GPU information (currently + limited to NVIDIA devices) (#90, via contribution by + 907Resident) + * (2.4.0 to 2.4.2: Packaging fixes) +- Add watermark-pr92-optional-py3nvml.patch gh#rasbt/watermark#92 + +------------------------------------------------------------------- Old: ---- watermark-2.3.1.tar.gz New: ---- watermark-2.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-watermark.spec ++++++ --- /var/tmp/diff_new_pack.q2Y80X/_old 2023-07-04 15:22:32.226262299 +0200 +++ /var/tmp/diff_new_pack.q2Y80X/_new 2023-07-04 15:22:32.234262347 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-watermark # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,8 @@ # -%{?!python_module:%define python_module() python3-%{**}} -%define skip_python2 1 Name: python-watermark -Version: 2.3.1 +Version: 2.4.3 Release: 0 Summary: IPython magic function to psystem information License: BSD-3-Clause @@ -27,11 +25,17 @@ URL: https://github.com/rasbt/watermark Source: https://files.pythonhosted.org/packages/source/w/watermark/watermark-%{version}.tar.gz BuildRequires: %{python_module base >= 3.8} -BuildRequires: %{python_module ipython} +BuildRequires: %{python_module importlib-metadata >= 1.4} +BuildRequires: %{python_module ipython >= 6} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-ipython +Requires: python-importlib-metadata >= 1.4 +Requires: python-ipython >= 6 +Requires: python-setuptools +Suggests: python-py3nvml >= 0.2 Provides: python-jupyter_watermark = %{version} Obsoletes: python-jupyter_watermark < %{version} BuildArch: noarch @@ -45,13 +49,13 @@ and hardware information. %prep -%setup -q -n watermark-%{version} +%autosetup -p1 -n watermark-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -62,6 +66,6 @@ %doc README.md %license LICENSE %{python_sitelib}/watermark-%{version}*-info -%{python_sitelib}/watermark/ +%{python_sitelib}/watermark %changelog ++++++ watermark-2.3.1.tar.gz -> watermark-2.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/MANIFEST.in new/watermark-2.4.3/MANIFEST.in --- old/watermark-2.3.1/MANIFEST.in 2022-01-04 02:25:16.000000000 +0100 +++ new/watermark-2.4.3/MANIFEST.in 2023-07-02 16:31:32.000000000 +0200 @@ -1,2 +1,3 @@ include LICENSE include README.md +include requirements.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/PKG-INFO new/watermark-2.4.3/PKG-INFO --- old/watermark-2.3.1/PKG-INFO 2022-05-27 15:55:16.059700300 +0200 +++ new/watermark-2.4.3/PKG-INFO 2023-07-02 16:32:01.037579000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: watermark -Version: 2.3.1 +Version: 2.4.3 Summary: IPython magic function to print date/time stamps and various system information. Home-page: https://github.com/rasbt/watermark Author: Sebastian Raschka Author-email: m...@sebastianraschka.com License: newBSD -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: IPython Classifier: Intended Audience :: Developers @@ -18,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Requires-Python: >=3.7 +Provides-Extra: gpu License-File: LICENSE An IPython magic extension for printing date and time stamps, version @@ -33,4 +33,3 @@ The documentation can be found at https://github.com/rasbt/watermark/blob/master/README.md - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/README.md new/watermark-2.4.3/README.md --- old/watermark-2.3.1/README.md 2022-05-27 15:53:24.000000000 +0200 +++ new/watermark-2.4.3/README.md 2023-07-02 16:31:32.000000000 +0200 @@ -22,17 +22,60 @@ [[top](#sections)] +### Using watermark in Jupyter notebooks and IPython sessions + + +   - **More examples can be found in this [Jupyter notebook](docs/watermark.ipynb).** [](https://mybinder.org/v2/gh/rasbt/watermark/master?filepath=docs%2Fwatermark.ipynb) <br> + +### Using watermark as a module + + +```python +from watermark import watermark +print(watermark()) +``` + +``` +Last updated: 2022-09-13T16:28:56.177487-05:00 + +Python implementation: CPython +Python version : 3.9.13 +IPython version : 8.4.0 + +Compiler : Clang 13.0.1 +OS : Darwin +Release : 21.6.0 +Machine : arm64 +Processor : arm +CPU cores : 10 +Architecture: 64bit +``` + +```python +print(watermark(packages="numpy,scipy")) +``` + +``` +numpy: 1.23.2 +scipy: 1.9.1 +``` + + + +See `help(watermark)` for more options. + + + ## Installation and updating [[top](#sections)] @@ -133,12 +176,23 @@ [[top](#sections)] +#### v. 2.4.3 (May 23, 2023) + +- Make `py3nvml` installation for GPU info optional. ([#92](https://github.com/rasbt/watermark/pull/92), via contribution by [Ben Greiner](https://github.com/bnavigator)) + +#### v. 2.4.1 and v 2.4.2 (May 23, 2023) + +- PyPI and Conda-Forge packaging fixes. + +#### v. 2.4.0 (May 23, 2023) + +- Adds a new `--gpu` flag to print out GPU information (currently limited to NVIDIA devices) ([#90](https://github.com/rasbt/watermark/pull/90), via contribution by [907Resident](https://github.com/907Resident)) #### v. 2.3.1 (May 27, 2022) - Upper limit on importlib-metadata caused trouble installing on Python 3.7. - Instead pin to minimum version with Python 3.8 functionality according to https://github.com/python/importlib_metadata#compatibility ([#86](https://github.com/rasbt/watermark/pull/63), via contribution by [James Myatt](https://github.com/jamesmyatt)) + Instead pin to minimum version with Python 3.8 functionality according to https://github.com/python/importlib_metadata#compatibility ([#86](https://github.com/rasbt/watermark/pull/86), via contribution by [James Myatt](https://github.com/jamesmyatt)) #### v. 2.3.0 (January 3, 2022) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/requirements.txt new/watermark-2.4.3/requirements.txt --- old/watermark-2.3.1/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/watermark-2.4.3/requirements.txt 2023-07-02 16:31:32.000000000 +0200 @@ -0,0 +1,2 @@ +ipython >= 6.0 +importlib-metadata >= 1.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/setup.cfg new/watermark-2.4.3/setup.cfg --- old/watermark-2.3.1/setup.cfg 2022-05-27 15:55:16.059921700 +0200 +++ new/watermark-2.4.3/setup.cfg 2023-07-02 16:32:01.037904500 +0200 @@ -1,5 +1,5 @@ [metadata] -version = 2.3.1 +version = 2.4.3 license_file = LICENSE classifiers = Development Status :: 5 - Production/Stable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/setup.py new/watermark-2.4.3/setup.py --- old/watermark-2.3.1/setup.py 2022-05-27 15:51:08.000000000 +0200 +++ new/watermark-2.4.3/setup.py 2023-07-02 16:31:32.000000000 +0200 @@ -5,10 +5,20 @@ # # License: BSD 3 clause +from os.path import dirname, join, realpath from textwrap import dedent from setuptools import find_packages, setup + +PROJECT_ROOT = dirname(realpath(__file__)) +REQUIREMENTS_FILE = join(PROJECT_ROOT, "requirements.txt") + +with open(REQUIREMENTS_FILE) as f: + install_reqs = f.read().splitlines() + +install_reqs.append("setuptools") + # Also see settings in setup.cfg setup( name="watermark", @@ -21,10 +31,8 @@ author_email="m...@sebastianraschka.com", url="https://github.com/rasbt/watermark", packages=find_packages(exclude=[]), - install_requires=[ - "ipython", - 'importlib-metadata >= 1.4 ; python_version < "3.8"', - ], + install_requires=install_reqs, + extras_require={'gpu': ['py3nvml>=0.2']}, long_description=dedent( """\ An IPython magic extension for printing date and time stamps, version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/watermark/magic.py new/watermark-2.4.3/watermark/magic.py --- old/watermark-2.3.1/watermark/magic.py 2022-01-04 02:54:42.000000000 +0100 +++ new/watermark-2.4.3/watermark/magic.py 2023-07-02 16:31:32.000000000 +0200 @@ -70,6 +70,9 @@ help='prints the current version of watermark') @argument('-iv', '--iversions', action='store_true', help='prints the name/version of all imported modules') + @argument('--gpu', action='store_true', + help='prints GPU information (currently limited to NVIDIA GPUs),' + ' if available') @line_magic def watermark(self, line): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/watermark/watermark.py new/watermark-2.4.3/watermark/watermark.py --- old/watermark-2.3.1/watermark/watermark.py 2022-01-04 02:25:26.000000000 +0100 +++ new/watermark-2.4.3/watermark/watermark.py 2023-07-02 16:31:32.000000000 +0200 @@ -18,6 +18,12 @@ import types from multiprocessing import cpu_count from socket import gethostname +import platform + +try: + from py3nvml import py3nvml +except ImportError: + py3nvml = None try: import importlib.metadata as importlib_metadata @@ -30,14 +36,32 @@ from .version import __version__ -def watermark(author=None, email=None, github_username=None, - website=None, current_date=False, datename=False, - current_time=False, iso8601=False, timezone=False, - updated=False, custom_time=None, python=False, - packages=None, conda=False, hostname=False, machine=False, - githash=False, gitrepo=False, gitbranch=False, - watermark=False, iversions=False, watermark_self=None, - globals_=None): +def watermark( + author=None, + email=None, + github_username=None, + website=None, + current_date=False, + datename=False, + current_time=False, + iso8601=False, + timezone=False, + updated=False, + custom_time=None, + python=False, + packages=None, + conda=False, + hostname=False, + machine=False, + githash=False, + gitrepo=False, + gitbranch=False, + watermark=False, + iversions=False, + gpu=False, + watermark_self=None, + globals_=None +): '''Function to print date/time stamps and various system information. @@ -107,6 +131,9 @@ iversions : prints the name/version of all imported modules + + gpu : + prints GPU information (currently limited to NVIDIA GPUs), if available watermark_self : instance of the watermark magics class, which is required @@ -182,6 +209,8 @@ "to show imported package versions." ) output.append(_get_all_import_versions(ns)) + if args['gpu']: + output.append(_get_gpu_info()) if args['watermark']: output.append({"Watermark": __version__}) @@ -306,3 +335,27 @@ def _get_conda_env(): name = os.getenv('CONDA_DEFAULT_ENV', 'n/a') return {"conda environment": name} + + +def _get_gpu_info(): + if py3nvml is None: + return {"GPU Info": "Install the gpu extra " + "(pip install 'watermark[gpu]') " + "to display GPU information for NVIDIA chipsets"} + try: + gpu_info = [""] + py3nvml.nvmlInit() + num_gpus = py3nvml.nvmlDeviceGetCount() + for i in range(num_gpus): + handle = py3nvml.nvmlDeviceGetHandleByIndex(i) + gpu_name = py3nvml.nvmlDeviceGetName(handle) + gpu_info.append(f"GPU {i}: {gpu_name}") + py3nvml.nvmlShutdown() + return {"GPU Info": "\n ".join(gpu_info)} + + except py3nvml.NVMLError_LibraryNotFound: + return {"GPU Info": "NVIDIA drivers do not appear " + "to be installed on this machine."} + except: + return {"GPU Info": "GPU information is not " + "available for this machine."} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/watermark.egg-info/PKG-INFO new/watermark-2.4.3/watermark.egg-info/PKG-INFO --- old/watermark-2.3.1/watermark.egg-info/PKG-INFO 2022-05-27 15:55:16.000000000 +0200 +++ new/watermark-2.4.3/watermark.egg-info/PKG-INFO 2023-07-02 16:32:00.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: watermark -Version: 2.3.1 +Version: 2.4.3 Summary: IPython magic function to print date/time stamps and various system information. Home-page: https://github.com/rasbt/watermark Author: Sebastian Raschka Author-email: m...@sebastianraschka.com License: newBSD -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: IPython Classifier: Intended Audience :: Developers @@ -18,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Requires-Python: >=3.7 +Provides-Extra: gpu License-File: LICENSE An IPython magic extension for printing date and time stamps, version @@ -33,4 +33,3 @@ The documentation can be found at https://github.com/rasbt/watermark/blob/master/README.md - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/watermark.egg-info/SOURCES.txt new/watermark-2.4.3/watermark.egg-info/SOURCES.txt --- old/watermark-2.3.1/watermark.egg-info/SOURCES.txt 2022-05-27 15:55:16.000000000 +0200 +++ new/watermark-2.4.3/watermark.egg-info/SOURCES.txt 2023-07-02 16:32:00.000000000 +0200 @@ -1,6 +1,7 @@ LICENSE MANIFEST.in README.md +requirements.txt setup.cfg setup.py watermark/__init__.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/watermark-2.3.1/watermark.egg-info/requires.txt new/watermark-2.4.3/watermark.egg-info/requires.txt --- old/watermark-2.3.1/watermark.egg-info/requires.txt 2022-05-27 15:55:16.000000000 +0200 +++ new/watermark-2.4.3/watermark.egg-info/requires.txt 2023-07-02 16:32:00.000000000 +0200 @@ -1,4 +1,6 @@ -ipython - -[:python_version < "3.8"] +ipython>=6.0 importlib-metadata>=1.4 +setuptools + +[gpu] +py3nvml>=0.2