From 07ef50844144d5fd98d45aa5604e46fc13f4587e Mon Sep 17 00:00:00 2001 From: "Javier M. Duarte" Date: Sat, 25 Dec 2021 08:42:06 -0800 Subject: [PATCH 1/9] bump version --- hls4ml/__init__.py | 2 +- setup.cfg | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/hls4ml/__init__.py b/hls4ml/__init__.py index 7c450cd347..0e55ee713e 100644 --- a/hls4ml/__init__.py +++ b/hls4ml/__init__.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -__version__ = '0.5.1' +__version__ = '0.6.0' from hls4ml import converters from hls4ml import report diff --git a/setup.cfg b/setup.cfg index 158e820f07..1968212fbb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,20 @@ +[bumpversion] +current_version = 0.6.0 +commit = True +message = + [SKIP] version bump {current_version} -> {new_version} + + {$COMMIT_MSG} +tag = True +tag_message = + version bump {current_version} -> {new_version} + + {$COMMIT_MSG} + +[bumpversion:file:hls4ml/__init__.py] +search = __version__ = '{current_version}' +replace = __version__ = '{new_version}' + [metadata] description-file = README.md @@ -5,6 +22,5 @@ description-file = README.md python_requires = >=3.7 [options.entry_points] -pytest_randomly.random_seeder = - hls4ml = hls4ml:reseed - +pytest_randomly.random_seeder = + hls4ml = hls4ml:reseed From 68fc5dec393d54f36749f1a5af8c46b922057ec6 Mon Sep 17 00:00:00 2001 From: "Javier M. Duarte" Date: Sat, 25 Dec 2021 14:46:08 -0800 Subject: [PATCH 2/9] add pyproject.toml --- hls4ml/__init__.py | 2 -- pyproject.toml | 8 ++++++++ setup.py | 10 +--------- 3 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 pyproject.toml diff --git a/hls4ml/__init__.py b/hls4ml/__init__.py index 0e55ee713e..247e3dabf0 100644 --- a/hls4ml/__init__.py +++ b/hls4ml/__init__.py @@ -1,7 +1,5 @@ from __future__ import absolute_import -__version__ = '0.6.0' - from hls4ml import converters from hls4ml import report from hls4ml import utils diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..1c4d231c7d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[build-system] +# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD! +requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +# See configuration details in https://github.com/pypa/setuptools_scm +version_scheme = "no-guess-dev" \ No newline at end of file diff --git a/setup.py b/setup.py index c2380ba607..31fdb4a1e6 100644 --- a/setup.py +++ b/setup.py @@ -9,16 +9,8 @@ def read(rel_path): with codecs.open(os.path.join(this_directory, rel_path), 'r') as fp: return fp.read() -def get_version(rel_path): - for line in read(rel_path).splitlines(): - if line.startswith('__version__'): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - else: - raise RuntimeError("Unable to find version string.") - setup(name='hls4ml', - version=get_version("hls4ml/__init__.py"), + use_scm_version={"version_scheme": "no-guess-dev"}, description='Machine learning in FPGAs using HLS', long_description=read('README.md'), long_description_content_type='text/markdown', From 770b3d7fed2f37a95e968615e25479ddb82a3154 Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 21 Jun 2022 20:13:31 -0700 Subject: [PATCH 3/9] update --- setup.cfg | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/setup.cfg b/setup.cfg index 1968212fbb..65a8be7ae6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,20 +1,3 @@ -[bumpversion] -current_version = 0.6.0 -commit = True -message = - [SKIP] version bump {current_version} -> {new_version} - - {$COMMIT_MSG} -tag = True -tag_message = - version bump {current_version} -> {new_version} - - {$COMMIT_MSG} - -[bumpversion:file:hls4ml/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - [metadata] description-file = README.md @@ -22,5 +5,5 @@ description-file = README.md python_requires = >=3.7 [options.entry_points] -pytest_randomly.random_seeder = - hls4ml = hls4ml:reseed +pytest_randomly.random_seeder = + hls4ml = hls4ml:reseed From e889a6017ca6d39d38d2be31e856a0844efba680 Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 21 Jun 2022 20:53:30 -0700 Subject: [PATCH 4/9] update --- hls4ml/__init__.py | 7 ++++++ pyproject.toml | 4 +++- setup.cfg | 35 ++++++++++++++++++++++++++++++ setup.py | 54 +++------------------------------------------- 4 files changed, 48 insertions(+), 52 deletions(-) diff --git a/hls4ml/__init__.py b/hls4ml/__init__.py index 247e3dabf0..5b0e6f1c25 100644 --- a/hls4ml/__init__.py +++ b/hls4ml/__init__.py @@ -4,6 +4,13 @@ from hls4ml import report from hls4ml import utils +try: + from ._version import version as __version__ + from ._version import version_tuple +except ImportError: + __version__ = "unknown version" + version_tuple = (0, 0, "unknown version") + def reseed(newseed): print('\npytest-randomly: reseed with {}'.format(newseed)) try: diff --git a/pyproject.toml b/pyproject.toml index 1c4d231c7d..ca9e73f205 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,4 +5,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] # See configuration details in https://github.com/pypa/setuptools_scm -version_scheme = "no-guess-dev" \ No newline at end of file +version_scheme = "no-guess-dev" +git_describe_command = "git describe --dirty --tags --long --match v* --first-parent" +write_to = "hls4ml/_version.py" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 65a8be7ae6..4bf9989821 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,44 @@ [metadata] description-file = README.md +name = hls4ml +author = HLS4ML Team +author_email = hls4ml.help@gmail.com +license = Apache 2.0 +description = Machine learning in FPGAs using HLS +url = https://fastmachinelearning.org/hls4ml +long_description = file: README.md +long_description_content_type = text/markdown +classifiers = + Development Status :: 3 - Alpha + Intended Audience :: Developers + Intended Audience :: Science/Research + License :: OSI Approved :: Apache Software License + Programming Language :: C++ + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Software Development :: Libraries + Topic :: Software Development :: Libraries :: Python Modules [options] python_requires = >=3.7 +packages = find: +install_requires = + numpy + six + pyyaml + h5py + onnx>=1.4.0 + calmjs.parse + tabulate + qkeras +include_package_data = True +scripts = scripts/hls4ml [options.entry_points] pytest_randomly.random_seeder = hls4ml = hls4ml:reseed + +[options.extras_require] +profiling = pandas; seaborn; matplotlib diff --git a/setup.py b/setup.py index 31fdb4a1e6..1abbd068c1 100644 --- a/setup.py +++ b/setup.py @@ -1,52 +1,4 @@ -from setuptools import setup -from setuptools import find_packages +import setuptools -import codecs -import os.path - -def read(rel_path): - this_directory = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(this_directory, rel_path), 'r') as fp: - return fp.read() - -setup(name='hls4ml', - use_scm_version={"version_scheme": "no-guess-dev"}, - description='Machine learning in FPGAs using HLS', - long_description=read('README.md'), - long_description_content_type='text/markdown', - author='HLS4ML Team', - author_email='hls4ml.help@gmail.com', - url='https://github.com/hls-fpga-machine-learning/hls4ml', - license='Apache 2.0', - install_requires=[ - 'numpy', - 'six', - 'pyyaml', - 'h5py', - 'onnx>=1.4.0', - 'calmjs.parse', - 'tabulate', - 'pydigitalwavetools==1.1', - 'qkeras', - ], - extras_require={ - 'profiling': [ - 'pandas', - 'seaborn', - 'matplotlib' - ] - }, - scripts=['scripts/hls4ml'], - include_package_data=True, - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: C++', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules' - ], - packages=find_packages()) +if __name__ == "__main__": + setuptools.setup() From 62dc4433389b8a0e0e918fbe4910c388b6104da0 Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 25 Oct 2022 06:51:16 -0700 Subject: [PATCH 5/9] update --- setup.cfg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4bf9989821..55070c6ccf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,7 @@ install_requires = onnx>=1.4.0 calmjs.parse tabulate + pydigitalwavetools==1.1 qkeras include_package_data = True scripts = scripts/hls4ml @@ -41,4 +42,7 @@ pytest_randomly.random_seeder = hls4ml = hls4ml:reseed [options.extras_require] -profiling = pandas; seaborn; matplotlib +profiling = + pandas + seaborn + matplotlib From 3abd03ab9cb8c88a76dbb20dfe815ae2039f2dfc Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 25 Oct 2022 08:59:24 -0700 Subject: [PATCH 6/9] gitignore update --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2303716f8c..26ce81e9b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.pyc +_version.py __pycache__ build/ dist/ From d65f976117ab95c1233786850f3c3a3185e425bf Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 25 Oct 2022 08:59:40 -0700 Subject: [PATCH 7/9] try different scheme --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ca9e73f205..dc0e95c208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] # See configuration details in https://github.com/pypa/setuptools_scm -version_scheme = "no-guess-dev" +version_scheme = "release-branch-semver" git_describe_command = "git describe --dirty --tags --long --match v* --first-parent" write_to = "hls4ml/_version.py" \ No newline at end of file From 098a68325f40d6442fe93a9a54109c078d91b02b Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 25 Oct 2022 08:59:53 -0700 Subject: [PATCH 8/9] lower tolerance pytest --- test/pytest/test_qkeras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pytest/test_qkeras.py b/test/pytest/test_qkeras.py index 346a444a5c..ee775cc5e5 100644 --- a/test/pytest/test_qkeras.py +++ b/test/pytest/test_qkeras.py @@ -305,7 +305,7 @@ def test_qactivation_kwarg(randX_100_10, np.testing.assert_allclose( y_qkeras.ravel(), y_hls4ml.ravel(), - atol=2**-eval(activation_quantizer).bits, + atol=2**-(eval(activation_quantizer).bits-1), rtol=1.0 ) else: From ed70a79d4049e4cc599a3607ac6e4cb6a5f86f8e Mon Sep 17 00:00:00 2001 From: Javier Duarte Date: Tue, 25 Oct 2022 16:58:53 -0700 Subject: [PATCH 9/9] Update setup.cfg --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 55070c6ccf..e8239e9e67 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,7 @@ [metadata] description-file = README.md name = hls4ml -author = HLS4ML Team -author_email = hls4ml.help@gmail.com +author = hls4ml Team license = Apache 2.0 description = Machine learning in FPGAs using HLS url = https://fastmachinelearning.org/hls4ml