Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install wheels on windows #6522

Closed
zillionare opened this issue Sep 15, 2022 · 9 comments
Closed

install wheels on windows #6522

zillionare opened this issue Sep 15, 2022 · 9 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@zillionare
Copy link

  • [ x] I am on the latest Poetry version.

  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.

  • [ x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: windows 11 Home

  • Poetry version: 1.2.0

the pyproject.toml:

[[tool.poetry.source]]
name = "ali"
url = "https://mirrors.aliyun.com/pypi/simple/"
secondary = true


[tool.poetry.dev-dependencies]
[tool.poetry]
name = "zillionare-omicron"
packages = [
    {include = "omicron"}
]
version = "2.0.0a47"
description = "Core Library for Zillionare"
authors = ["jieyu <[email protected]>"]
license = "MIT"
readme = "README.md"
homepage = "https://zillionare-omicron.readthedocs.io"
repository = "https://github.com/zillionare/omicron"
documentation = "https://zillionare-omicron.readthedocs.io"
keywords = ["AI", "quant", "trade", "stock"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Natural Language :: English",
    "Programming Language :: Python :: 3.8",
]
include = [
    "LICENSE",
    "README.md",
    "HISTORY.md",
    "AUTHORS.md",
    "docs/*",
    "tests/*",
    "packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl"
]

[tool.poetry.dependencies]
python = ">=3.8,<3.9"
sh = "1.14.1"
aiohttp = "^3.8.0"
cfg4py = ">=0.9"
numpy = "^1.22"
aioredis = "1.3.1"
aiosmtplib = "^1.1.6"
pandas = "^1.3.5"
zillionare-core-types = "^0.5.2"
ciso8601 = "^2.2.0"
Bottleneck = "^1.3.4"
scikit-learn = "^1.0.2"
empyrical-reloaded = "^0.5.8"
zigzag = "^0.3"

black = {version = "^22.3.0", optional = true}
isort  = { version = "5.10.1", optional = true}
flake8  = { version = "4.0.1", optional = true}
flake8-docstrings = { version = "^1.6.0", optional = true }
pytest  = { version = "^7.0.1", optional = true}
pytest-cov  = { version = "^3.0.0", optional = true}
tox  = { version = "^3.24.5", optional = true}
pip  = { version = "^22.0.3", optional = true}
psutil  = { version = "^5.7.3", optional = true}

mkdocs  = { version = "^1.3.0", optional = true}
mkdocs-include-markdown-plugin  = { version = "^3.2.3", optional = true}
mkdocs-material  = { version = "^8.1.11", optional = true}
mkdocstrings  = { version = "^0.18.0", optional = true}
mkdocs-material-extensions  = { version = "^1.0.3", optional = true}
twine  = { version = "^3.8.0", optional = true}
mkdocs-autorefs = {version = "^0.3.1", optional = true}
pre-commit = {version = "^2.17.0", optional = true}
toml = {version = "^0.10.2", optional = true}
livereload = {version = "^2.6.3", optional = true}
pyreadline = {version = "^2.1", optional = true}
mike = { version="^1.1.2", optional=true}
freezegun = {version = "^1.2.1", optional = true}
httpx = "^0.23.0"
deprecation = "^2.1.0"
arrow = "^1.2"
plotly = "^5.10.0"
ckwrap = "^0.1.10"
TA-Lib = {version = "^0.4.25", platform = "linux"}
ta-lib = {path = "./packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl", platform = "win32"}

[tool.poetry.extras]
test = [
    "pytest",
    "black",
    "isort",
    "flake8",
    "flake8-docstrings",
    "pytest-cov",
    "psutil",
    "freezegun"
    ]

dev = ["tox", "pre-commit", "pip", "twine", "toml"]

doc = [
    "mkdocs",
    "mkdocs-include-markdown-plugin",
    "mkdocs-material",
    "mkdocstrings",
    "mkdocs-material-extension",
    "mkdocs-autorefs",
    "Jinja2",
    "livereload",
    "mike"
    ]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
    \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | \.history
  | _build
  | buck-out
  | build
  | dist
)/
'''
[tool.isort]
profile = "black"

the problem I tried to solving is to install ta-lib, which involves native talib.lib. On windows there's pre-built wheels available, and I decide to include it to my package, so I add this by:

poetry add path/to/ta-lib*wheel --platform win32

and put the wheel to ./packages folder (which is at same level as pyproject.toml, and included by:

include = [
    "packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl"
]

things works well until now. However, when I tried to install my package (which name is omicron), it always failed with:

pip._vendor.pkg_resources.RequirementParseError: Invalid URL: packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl

I wonder the path sep should be '' instead of '/' ? however, with '\', it doesn't work too.

@zillionare zillionare added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 15, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 15, 2022

You cannot create a useful package that depends on local file dependencies. This is not a poetry thing, it's just how the world is.

However you express the dependency, and whether or not you try to bundle a wheel within a wheel: the path that you point at simply won't exist for the user trying to install the package.

What you are trying to do cannot work.

@zillionare
Copy link
Author

You cannot create a useful package that depends on local file dependencies. This is not a poetry thing, it's just how the world is.

However you express the dependency, and whether or not you try to bundle a wheel within a wheel: the path that you point at simply won't exist for the user trying to install the package.

What you are trying to do cannot work.

Hi dimbleby:
thanks for replying.

from poetry's document (https://poetry.eustace.io/docs/versions/#multiple-constraints-dependencies) and #1616, I think poetry should already supported this usage, just it doesn't work on my case (or, i don't know how to make it work).

and I had already packed the required wheels to release package by specify it in "include" section, as my pyproject.toml says. poetry build doesn't complain about this at all and I have checked omicron.whl, the required package (which is ta-libwin64.whl) already in it.

hope it's more clear now.

@zillionare
Copy link
Author

by the way, if this is not a case poetry should support, what the use case when we add local file dependency by poetry add ? Just for development mode?

@dimbleby
Copy link
Contributor

poetry supports file dependencies for local development.

However you cannot expect to build a wheel that has a file dependency and then install that wheel. This bit:

include = [
    "packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl"
]

cannot help

@zillionare
Copy link
Author

poetry supports file dependencies for local development.

However you cannot expect to build a wheel that has a file dependency and then install that wheel. This bit:

include = [
    "packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl"
]

cannot help

understand. Would you please address this in documentation if it's not addressed already?

@zillionare
Copy link
Author

poetry supports file dependencies for local development.

However you cannot expect to build a wheel that has a file dependency and then install that wheel. This bit:

include = [
    "packages/TA_Lib-0.4.24-cp38-cp38-win_amd64.whl"
]

cannot help

still not understood, sorry. What's the point that we add this deps to pyproject file just for local development? I guess after poetry build, we still cannot install that package locally?

@dimbleby
Copy link
Contributor

to reiterate, this is not a poetry question. No tool can build a useful wheel with a file dependency, because a path on your machine will not exist or contain the same items as a path on some other user's machine.

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 15, 2022
@neersighted
Copy link
Member

Poetry can be used as the only tool to manage/install your application (in which case file/URL direct dependencies are something you can reason about), or as a tool to develop a package to distribute and depend on elsewhere. For the latter use case, you cannot use direct dependencies as they will not be available to all users.

You should use a constraint and publish your package to an index if you want to depend on it in your package.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

3 participants