Comments (13)
Feel free to have a look at #903 :)
We plan to release 2.0.2 soon, it's very likely it'll include this fix.
from param.
How did you install param? It looks like it was done with a Linux distribution, which did not package the _version
file.
from param.
param was built and installed using the PEP517-compliant build
and install
projects within the FreeBSD ports framework.
from param.
Hi @yurivict, you mention the install
project, is it thin one https://pypi.org/project/install/?
I've just tried the following with success:
- Clone the repo and cd into it
python3 -m venv .venv
andsource .venv/bin/activate
python -m build
pip install dist/param-2.0.2.dev2+g3e90912-py3-none-any.whl
mkdir foo && cd foo
- Run the Python interpreter and
import param
Could you please report the exact steps that lead you to the error you reported?
from param.
Here is the log.
from param.
Thanks @yurivict, but I'm still confused by this issue.
I've tried to reproduce locally some of the steps you shared in this log file (get sdist, install build/installer/hatchling/hatch-vcs, isolated wheel build, wheel installed with installer) and could import param without any issue.
Coming back to your traceback, it clearly shows that the param/_version.py
module exists (otherwise you would see a ModuleNotFoundError
) but that it does not contain a __version__
variable, resulting in an ImportError
. However, I can confirm that the sdist on PyPI has a __version__
variable in the param/_version.py
module:
❯ curl -sL "https://files.pythonhosted.org/packages/14/c8/b42882ed1ba40478d5c1daa6fbb953c8180ea69fe94b9e6783060f5564ae/param-2.0.1.tar.gz" | tar -xzO "param-2.0.1/param/_version.py"
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
__version__ = version = '2.0.1'
__version_tuple__ = version_tuple = (2, 0, 1)
Maybe you could check the content of param/_version.py
in your pipeline?
from param.
Oh wait wait wait, I think I know, do you download param-2.0.1.tar.gz
from Github?
from param.
Oh wait wait wait, I think I know, do you download param-2.0.1.tar.gz from Github?
No, the tarball is downloaded from the PYPI site: https://pypi.org/packages/source/p/param/param-2.0.1.tar.gz
from param.
Ok ok. I'm at a loss there :/ Really wish I could unblock you. I'd be curious to see the content of param._version.py
at different stages of your pipeline.
from param.
Before build:
$ cat ./work-py39/param-2.0.1/param/_version.py
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
__version__ = version = '2.0.1'
__version_tuple__ = version_tuple = (2, 0, 1)
After build:
$ cat ./work-py39/param-2.0.1/param/_version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '2.0.1'
version_tuple = (2, 0, 1)
from param.
py39-setuptools_scm-6.4.2 is used.
from param.
The latest is setuptools-scm 8.0.4, but it wasn't yet adopted.
Now I vaguely remember that a similar problem happened with some other port because setuptools-scm was 6.x, and they had to patch the project in some way because setuptools-scm changed behavior between versions.
from param.
Indeed __version__
was added in _version.py
to setuptools-scm in version 7.0.0 (part of this massive PR https://github.com/pypa/setuptools_scm/pull/580/files#diff-bdefa0298003efada7c465428643cc6d9c129168afb3eb5c551b40fcc77feac1R42).
To add compatibility to older versions of setuptools-scm it seems we could try to import version
if importing __version__
fails. I also see in their docs they suggest using:
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("package-name")
except PackageNotFoundError:
# package is not installed
pass
from param.
Related Issues (20)
- 2.0.0rc6 - param.ListSelector Issue HOT 7
- In Windows, `import param` pops up a command line window HOT 3
- A “doc” directory is installed directly in site-packages
- Speed up load with 2% by improving _register_watcher HOT 3
- Speed up derived applications like Panel by speeding up Path Parameter
- Make it easy to use Traitlets including Ipywidgets/ AnyWidgets with Param HOT 1
- param.A + param.B = Param.C, how to express this relationship beween parameters ? HOT 2
- Add a `metadata` slot
- Cannot change instance attributes with a Callable without passing in parameterized class HOT 3
- Define Comparator equality functions for more types HOT 1
- DeprecationWarning in test_reactive_logic_unary_ops HOT 1
- Default range of param.Range fails to update using self.param.<parameter>.default assignment HOT 4
- Ability to apply @param.depends to all (nested) Parameters of a class HOT 1
- Param with bounds should default to lower bound HOT 7
- Add .is_active parameter to reactive expressions HOT 3
- Let reactive expressions .watch method support async functions
- Context manager .param.update should restore references
- Let pn.Param accept a list of objects HOT 1
- Warn on errors thru rx updates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from param.