From aa2ddf00c7f8c3233abbe234ce5cd74dcdc8ba78 Mon Sep 17 00:00:00 2001 From: Thomas Morris Date: Thu, 1 Feb 2024 16:31:39 -0500 Subject: [PATCH] use build in pypi upload workflow --- .github/workflows/publish-pypi.yml | 4 ++-- LICENSE | 29 +++++++++++++++++++++++++++++ blop/_version.py | 4 ++-- blop/agent.py | 3 ++- pyproject.toml | 10 ++++++++-- 5 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 3dad078..3a89bfd 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -30,8 +30,8 @@ jobs: run: | set -vxeuo pipefail python -m pip install --upgrade pip - pip install wheel setuptools - python setup.py sdist bdist_wheel + pip install build + python -m build - name: Publish wheels to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7bbe974 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2020, Brookhaven National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/blop/_version.py b/blop/_version.py index 135beae..da4c33a 100644 --- a/blop/_version.py +++ b/blop/_version.py @@ -13,5 +13,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = "0.5.1.dev49+g3f61750.d20240131" -__version_tuple__ = version_tuple = (0, 5, 1, "dev49", "g3f61750.d20240131") +__version__ = version = "0.6.1.dev0" +__version_tuple__ = version_tuple = (0, 6, 1, "dev0") diff --git a/blop/agent.py b/blop/agent.py index 660731e..079d07d 100644 --- a/blop/agent.py +++ b/blop/agent.py @@ -11,7 +11,6 @@ import gpytorch import h5py import matplotlib as mpl -import napari import numpy as np import pandas as pd import scipy as sp @@ -410,6 +409,8 @@ def view(self, item: str = "mean", cmap: str = "turbo", max_inputs: int = 2**16) The thing to be viewed. Either 'mean', 'error', or an acquisition function. """ + import napari # noqa E402 + test_grid = self.sample(n=max_inputs, method="grid") self.viewer = napari.Viewer() diff --git a/pyproject.toml b/pyproject.toml index 991960d..23eba6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,6 @@ dependencies = [ "gpytorch", "h5py", "matplotlib", - "napari", "numpy", "ophyd", "ortools", @@ -49,6 +48,10 @@ sirepo = [ "sirepo-bluesky" ] +napari = [ + "napari" +] + dev = [ "black", "pytest-codecov", @@ -84,12 +87,15 @@ exclude = [ ] [tool.setuptools_scm] -version_file = "pkg/_version.py" +version_file = "blop/_version.py" [tool.hatch] version.source = "vcs" build.hooks.vcs.version-file = "blop/_version.py" +[tool.hatch.version.raw-options] +local_scheme = "no-local-version" + [tool.black] line-length = 125 include = '\.pyi?$'