david-oconnor / pyflow Goto Github PK
View Code? Open in Web Editor NEWAn installation and dependency system for Python
License: MIT License
An installation and dependency system for Python
License: MIT License
Attempting to use this tool behind a proxy doesn't seem to work. In a corporate environment, these are necessary to download Python and packages. Looks like there is a crate to help with it though:
https://docs.rs/env_proxy/0.4.0/env_proxy/
Not sure what other information you might need for this, but let me know and I can try to provide it.
pyflow verison: 0.1.5
OS: WSL (windows subsystem for linux ver. 1)
I started a new project with pyflow new, then tried to add dependencies and getting (run with backtrace=full):
RUST_BACKTRACE=full pyflow install starlette Found lockfile
🔍 Resolving dependencies...
⬇ Installing starlette 0.12.9 ...
thread 'main' panicked at 'Problem reading the dist directory of a package built from source. The `wheel` package have not have been installed in this environment.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1084:5
stack backtrace:
0: 0x7f782526cceb - <unknown>
1: 0x7f782526c9c6 - <unknown>
2: 0x7f782526d45d - std::panicking::rust_panic_with_hook::h92f98b46e22f14ed
3: 0x7f782526cfe2 - <unknown>
4: 0x7f782526cec6 - rust_begin_unwind
5: 0x7f782528ef9d - core::panicking::panic_fmt::h7e9f94035af782b3
6: 0x7f782528f097 - core::result::unwrap_failed::hf7591c1dd9412006
7: 0x7f7824f719d4 - <unknown>
8: 0x7f7824f57652 - <unknown>
9: 0x7f7824f5fcb0 - <unknown>
10: 0x7f7824ec7f23 - <unknown>
11: 0x7f782526ce63 - <unknown>
12: 0x7f7825276b8a - __rust_maybe_catch_panic
13: 0x7f782526da2d - std::rt::lang_start_internal::hea1b49a567afe309
14: 0x7f7824f644b2 - <unknown>
15: 0x7f7823701b97 - __libc_start_main
16: 0x7f7824e8c289 - <unknown>
17: 0x0 - <unknown>
I managed to install yapf, but many others fail. For example installing pytest breaks when wcwidth is installed for example.
Can you install dependencies are dev only? Akin to poetry add --dev flake8
?
I noticed Cargo fills in your name/email from git info and creates a VCS repo for new projects. I think it's worth copying for pyflow new
since it already generates a project template.
I installed black
(pflow install --dev black
) and set "python.autoComplete.extraPaths": ["__pypackages__/3.7/lib"]
, but VSCode formatter did not work.
Setting black
path to __pypackages__/3.7/bin/black
or __pypackages__/3.7/lib/black
has no effects. Are there any workarounds?
Note that pflow black
works as expected.
It would be great if users can install pyflow with pip
. It can be done by publishing a prebuilt binary wheel on PyPI for every OS arch. I am not familiar with this task but setuptools-rust
may be helpful.
pyflow install termcolor failed and so far I tracked that setup.py has no bdist_wheel target, changing target to bdist moves the error a little bit forward but later it stops trying to unzip the dist file.
Pyflow 0.1.9, Fedora 31, Python 3.7.5.
/tmp $ pyflow new ppp
Created a new Python project named ppp
/tmp $ cd ppp
/t/ppp (master|…) $ nvim pyproject.toml
/t/ppp (master|…) $ cat pyproject.toml
# See PEP 518: https://www.python.org/dev/peps/pep-0518/ for info on this file's structure.
[tool.pyflow]
name = ""
py_version = "3.7"
version = "0.1.0"
authors = ["..."]
[tool.pyflow.scripts]
[tool.pyflow.dependencies]
[tool.pyflow.dev-dependencies]
pytest = "*"
/t/ppp (master|…) $ pyflow install
Found multiple compatible Python versions. Please enter the number associated with the one you'd like to use:
1: python3.7: 3.7.5
2: python3: 3.7.5
3: python: 3.7.5
3
🐍 Setting up Python...
🔍 Resolving dependencies...
Problem getting dependency data - this is likely a bug in the cacheing process. Please try again in a few minutes. Reqs: [
Req {
name: "six",
constraints: [],
extra: None,
sys_platform: None,
python_version: None,
install_with_extras: None,
path: None,
git: None,
},
Req {
name: "pyparsing",
constraints: [
Constraint {
type_: Gte,
version: 2.0.2,
},
],
extra: None,
sys_platform: None,
python_version: None,
install_with_extras: None,
path: None,
git: None,
},
]
There are currently no Mac binaries or installers available. There should be no reason this doesn't work on Mac, but it's untested, and requires building from source, or installing via Cargo
for now.
I've started a new package, installed uvicorn and fastapi and put the following in main.py:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
Trying to run this with pyflow python uvicorn package:main
,pyflow uvicorn package:main
doesn't work, can you clarify the syntax for running servers like gunicorn
, uvicorn
or hypercorn
?
Is version 2.18 mandatory, or could it work with 2.17?
diff --git a/src/main.rs b/src/main.rs
index 20c4eea..8e90630 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -144,7 +144,7 @@ Install packages from `pyproject.toml`, `pyflow.lock`, or speficied ones. Exampl
#[structopt(name = "args")]
args: Vec<String>,
},
- /// Change Python versions for this project. eg `pyflow swtich 3.7`. Equivalent to setting
+ /// Change Python versions for this project. eg `pyflow switch 3.7`. Equivalent to setting
/// `py_version` in `pyproject.toml`.
#[structopt(name = "switch")]
Switch {
scoop install pyflow
WARN Scoop uses 'aria2c' for multi-connection downloads.
WARN Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
Installing 'pyflow' (0.2.5) [64bit]
Loading pyflow.zip from cache.
Checking hash of pyflow.zip ... ok.
Extracting pyflow.zip ... done.
Linking ~\scoop\apps\pyflow\current => ~\scoop\apps\pyflow\0.2.5
Creating shim for 'pyflow'.
Can't shim 'pyflow.exe': File doesn't exist.
Pinning to v0.2.4 works for now:
scoop install [email protected]
WARN Given version (0.2.4) does not match manifest (0.2.5)
WARN Attempting to generate manifest for 'pyflow' (0.2.4)
Autoupdating pyflow
Downloading pyflow.zip to compute hashes!
Loading pyflow.zip from cache
Computed hash: 8724de8e6cbb5e4b3eb9653640b920ae08b595c1aebd1eda9df77db49ec4f308
Writing updated pyflow manifest
WARN Scoop uses 'aria2c' for multi-connection downloads.
WARN Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
Installing 'pyflow' (0.2.4) [64bit]
Loading pyflow.zip from cache.
Checking hash of pyflow.zip ... ok.
Extracting pyflow.zip ... done.
Linking ~\scoop\apps\pyflow\current => ~\scoop\apps\pyflow\0.2.4
Creating shim for 'pyflow'.
'pyflow' (0.2.4) was installed successfully!
When dependency is a source only distribution, I got error. Here is a procedure to reproduce it.
pyflow 0.2.3
OS: Linux Mint 19.2
~/tmp$ pyflow new proj
Please enter the Python version for this project: (eg: 3.8)
3.8
Created a new Python project named proj
~/tmp$ cd proj
~/tmp/proj (master #)$ RUST_BACKTRACE=full pyflow install ifaddr
⬇ Installing ifaddr 0.1.6 ...
thread 'main' panicked at 'Problem running setup.py bdist_wheel: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
stack backtrace:
0: 0x55d79b1daba4 - <unknown>
1: 0x55d79b20342c - core::fmt::write::h01edf6dd68a42c9c
2: 0x55d79b1d50c7 - <unknown>
3: 0x55d79b1dd745 - <unknown>
4: 0x55d79b1dd436 - <unknown>
5: 0x55d79b1dde45 - std::panicking::rust_panic_with_hook::h825f041245da8739
6: 0x55d79b1dd9e2 - <unknown>
7: 0x55d79b1dd8d6 - rust_begin_unwind
8: 0x55d79b1ffe9a - core::panicking::panic_fmt::h527855ce0bc891f6
9: 0x55d79b1fff97 - core::result::unwrap_failed::ha8b77e6004f0ba38
10: 0x55d79ae69812 - <unknown>
11: 0x55d79ae422f1 - <unknown>
12: 0x55d79ae4d248 - <unknown>
13: 0x55d79ae7dd53 - <unknown>
14: 0x55d79b1dd873 - <unknown>
15: 0x55d79b1e7c3a - __rust_maybe_catch_panic
16: 0x55d79b1de33d - std::rt::lang_start_internal::h409d4f2fe51133b0
17: 0x55d79ae519c2 - <unknown>
18: 0x7f5767267b97 - __libc_start_main
19: 0x55d79ad76dc9 - <unknown>
20: 0x0 - <unknown>
~/tmp/proj (master #)$
I realise it goes against the 'quick-n-dirty' nature of this feature, but would be great if it supported pip style version spec like:
__requires__ = ['tornado<5', 'pywin32==227']
import tornado.httpserver
import win32api
In 0.2.5 I get the following error:
$ RUST_BACKTRACE=full pyflow script server.py
thread 'main' panicked at 'Problem getting version info for tornado<5', src\main.rs:1016:41
stack backtrace:
0: 0x7ff6f30c5229 - <unknown>
1: 0x7ff6f30e61bb - <unknown>
2: 0x7ff6f30bd7f4 - <unknown>
3: 0x7ff6f30c7d09 - <unknown>
4: 0x7ff6f30c795c - <unknown>
5: 0x7ff6f30c853c - <unknown>
6: 0x7ff6f30c80c0 - <unknown>
7: 0x7ff6f30c8004 - <unknown>
8: 0x7ff6f2d38a23 - <unknown>
9: 0x7ff6f2cfb89e - <unknown>
10: 0x7ff6f2d0c0b6 - <unknown>
11: 0x7ff6f30c7f17 - <unknown>
12: 0x7ff6f30d5b42 - <unknown>
13: 0x7ff6f30c8762 - <unknown>
14: 0x7ff6f2d0b6f7 - <unknown>
15: 0x7ff6f3106ce4 - <unknown>
16: 0x7ff86be77bd4 - BaseThreadInitThunk
17: 0x7ff86c0eced1 - RtlUserThreadStart
Hey, thanks for making this tool - trying it out now.
Noticed installation of python binaries goes into ~/python-installs, I'm on a bit of a crusade to clean up my home directory so I know what's worth backing up and not.
Would it be possible to put them in a ~/.local subdirectory?
In this example I think the path would be ~/.local/bin/python-installs/
Got this by running systemd-path user-binaries
.
Just wanted to open up a discussion on where installed resources land in a user directory! Feel free to mark this closed if ~/python-installs is by design or by preference.
Thanks again!
More here:
https://www.freedesktop.org/software/systemd/man/file-hierarchy.html#Home%20Directory
I am trying out pyflow, and when I am creating a new project using command pyflow new cool_project
I am getting following error.
pyflow: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
I downloaded the binary and put that in the PATH, I am runnung Fedora 30 with python 3,7.4 and rust lang 1.38.
Thanks for creating this! I ran into an issue, however, upon initial usage when using pyflow to install pytorch:
~> pyflow new test_pyflow_1
Please enter the Python version for this project: (eg: 3.8)
3.7
Created a new Python project named test_pyflow_1
> cd test_pyflow_1/
~/test_pyflow_1 > ../pyflow install torch
🐍 Setting up Python...
⬇ Installing future 0.18.2 ...
thread 'main' panicked at 'Problem running setup.py bdist_wheel: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1188:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
I am running on Arch Linux with kernel 5.6.7. I tried using the downloadable binary, installing via cargo, and using the package in the AUR, all with the same result.
I’m using Fedora and after creating a new project, I was asked the following:
$ pyflow install aiohttp
Found multiple compatible Python versions. Please enter the number associated with the
one you’d like to use:
1: python3.7: 3.7.5
2: python3: 3.7.5
3: python: 3.7.5
Pyflow could detect it’s linking to the same version. Maybe it could even see if it’s about symlink to the same binary.
And then not ask this question.
Hello.
Now, pyflow init
generates LICENSE
, which I don't think is useful.
This is because I create license file on github.com, and empty LICENSE
makes it unavailable.
I have two alternative ideas as follows.
pyflow init
does not create LICENSE
pyflow init
make user choose using license (including nothing), and generates it as users choose.As you know, cargo new
does not create LICENSE
, for the first idea is sufficient, I think.
Please think on it.
Regards.
Reading the Readme, the point about pyflow using a cache stood out to me. Pip does it as well; on POSIX systems, look at ~/.cache/pip/wheels
. Was there a reason it's not used for pyflow?
$ pyflow install flasgger
Found lockfile
Resolving dependencies...
Can't find a compatible package for Req { name: "jsonschema", constraints: [Constraint { type_: Lt, version: 3.0.0 }], extra: None, sys_platform: None, python_version: None, install_with_extras: None, path: None, git: None }
I tried running cargo clippy -- -W clippy::pedantic -W clippy::nursery -W clippy::cargo
over pyflow, and I noticed that it suggested fixes for some of your todos (especially with filter_map
). You may find it handy.
I am currently behind a firewall and need to support Self-Signed trusted Certificates. I have found no documentation on how to configure pyflow to use the ca-bundle. Below is the error i get when i try to use it.
PS C:\Users\w-user\project> pyflow install
Downloading Python 3.8.0...
thread 'main' panicked at 'Problem downloading Python: Error(Hyper(Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: WebPKIError(UnknownIssuer) } })), "https://github.com/David-OConnor/pybin/releases/download/3.8.0/python-3.8.0-windows.tar.xz")', src\libcore\result.rs:1188:5
stack backtrace:
0: 0x7ff722165229 - <unknown>
1: 0x7ff7221861bb - <unknown>
2: 0x7ff72215d7f4 - <unknown>
3: 0x7ff722167d09 - <unknown>
4: 0x7ff72216795c - <unknown>
5: 0x7ff72216853c - <unknown>
6: 0x7ff7221680c0 - <unknown>
7: 0x7ff722182bdd - <unknown>
8: 0x7ff722182cdf - <unknown>
9: 0x7ff721ddc2b3 - <unknown>
10: 0x7ff721d5ff59 - <unknown>
11: 0x7ff721d9a3b0 - <unknown>
12: 0x7ff721dac0b6 - <unknown>
13: 0x7ff722167f17 - <unknown>
14: 0x7ff722175b42 - <unknown>
15: 0x7ff722168762 - <unknown>
16: 0x7ff721dab6f7 - <unknown>
17: 0x7ff7221a6ce4 - <unknown>
18: 0x7ffd36fb7974 - BaseThreadInitThunk
19: 0x7ffd3998a271 - RtlUserThreadStart
Is this feature not supported? If so can you add support for it? Ideally I would like to give the path of ca-bundle in pyproject.toml and it needs to be used for any requests you make.
Eg: Installation of python or Install from pip or install from github.
Conda uses hard links between installed dependencies as a means of decreasing overall space. As best I could determine (without checking the code) I don't think pyflow does.
I have found this to be very useful in many scenarios:
I think it would be great if pyflow could implement something similar.
(And thanks again for writing this tool, which addresses an important need!)
I installed with cargo from the master branch. When I run pyflow install numpy
after entering a directory created with pyflow new projectname
, I get (with RUST_BACTRACE=full
):
🐍Setting up Python environment...
thread 'main' panicked at 'Problem creating lib directory: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
stack backtrace:
0: 0x10d0ff995 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h458d13cb63d0c050
1: 0x10d1259e0 - core::fmt::write::h53670af22ec3875f
2: 0x10d0fa08b - std::io::Write::write_fmt::haf3d8737b9e851a5
3: 0x10d101c8a - std::panicking::default_hook::{{closure}}::h3fbc052481cb023f
4: 0x10d101995 - std::panicking::default_hook::h47b52fdc388b3b91
5: 0x10d102357 - std::panicking::rust_panic_with_hook::he9c773346a268707
6: 0x10d101ecd - std::panicking::continue_panic_fmt::h6ce88923515447fe
7: 0x10d101e29 - rust_begin_unwind
8: 0x10d13b59f - core::panicking::panic_fmt::h374d7a5fcdeaf2cf
9: 0x10d13b679 - core::result::unwrap_failed::hdf38bf4ba53b175b
10: 0x10cd74fb4 - pyflow::install::download_and_install_package::h962f28ab57bd4aee
11: 0x10cd69612 - pyflow::py_versions::create_venv::hcb44ecfaa27a005d
12: 0x10cd05525 - pyflow::util::find_venv_info::hb763c03c66689fc0
13: 0x10cd45d58 - pyflow::main::hdf0794e46e104969
14: 0x10cd29536 - std::rt::lang_start::{{closure}}::h26547f149e205262
15: 0x10d101da8 - std::panicking::try::do_call::h1875c1f8f5700dda
16: 0x10d10aaef - __rust_maybe_catch_panic
17: 0x10d1027be - std::rt::lang_start_internal::h5206fcf99580d1b5
18: 0x10cd4c699 - main
pyflow install ufolib2
$ pyflow install ufolib2
Found lockfile
⬇ Installing ufolib2 0.5.1 ...
⬇ Installing attrs 19.3.0 ...
Installation complete
It should also install fonttools, see https://github.com/fonttools/ufoLib2/blob/master/setup.cfg. Not sure what's going on there.
Cool project!
Is it currently possible to make use of custom build systems for use with cython- and/or cmake-built extensions? If not, is this on the roadmap?
This is something I need in many of my projects that I've gotten working well with poetry via the use of a build.py
file. I found a TODO reference to custom build systems; rather than digging more deeply into the source code (especially as someone with minimal familiarity with Rust) or playing around with the tool too much, I figured I might get a quicker answer by just asking.
git clone https://github.com/daltonmaag/statmake
pyflow install
pyflow
-- should display some 3.6.x versionpyflow switch 3.8
-- or something else you have lying aroundpyflow
-- still displays 3.6.x :(Maybe match python/pip syntax; -v
is verbose, -vv
is more verbose and so on.
FYI I'm adding this issue first as on first use I get an error when trying to install any package:
$ pyflow install black
Resolving dependencies...
Problem getting dependency data: DependencyError { details: "Network error" }
Not adding an issue for this error in case its something simple I'm missing, that logging would help identify.
FYI I'm using git for windows shell (MSYS2), installing by dropping binary in /usr/local/bin/
With a fresh project, specifying only py_version = "3.7"
> env RUST_BACKTRACE=full pyflow
Please enter the number corresponding to your Linux distro:
1: 2016 or newer (Ubuntu≥16.04, Debian≥9, SUSE≥15, Arch, Kali, etc)
2: Older (Centos, Redhat, Fedora, older versions of distros listed in option 1)
1
Installing Python 3.7.4...
🐍 Setting up Python...
thread 'main' panicked at 'Timed out waiting for venv to be created.: AliasError { details: "Timed out attempting to create a directory" }', src/libcore/result.rs:1165:5
stack backtrace:
0: 0x55c09138bba4 - <unknown>
1: 0x55c0913b442c - core::fmt::write::h01edf6dd68a42c9c
2: 0x55c0913860c7 - <unknown>
3: 0x55c09138e745 - <unknown>
4: 0x55c09138e436 - <unknown>
5: 0x55c09138ee45 - std::panicking::rust_panic_with_hook::h825f041245da8739
6: 0x55c09138e9e2 - <unknown>
7: 0x55c09138e8d6 - rust_begin_unwind
8: 0x55c0913b0e9a - core::panicking::panic_fmt::h527855ce0bc891f6
9: 0x55c0913b0f97 - core::result::unwrap_failed::ha8b77e6004f0ba38
10: 0x55c091012dc5 - <unknown>
11: 0x55c090fd8b7b - <unknown>
12: 0x55c090ffa202 - <unknown>
13: 0x55c09102ed53 - <unknown>
14: 0x55c09138e873 - <unknown>
15: 0x55c091398c3a - __rust_maybe_catch_panic
16: 0x55c09138f33d - std::rt::lang_start_internal::h409d4f2fe51133b0
17: 0x55c0910029c2 - <unknown>
18: 0x7f3402dc12e1 - __libc_start_main
19: 0x55c090f27dc9 - <unknown>
20: 0x0 - <unknown>
> tree __pypackages__/
__pypackages__/
└── 3.7
└── lib
2 directories, 0 files
Environment:
pyflow init
seems to pick up the wrong name field from git config. My gitconfig:
[user]
name = a
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
It uses the name
field under the merge
table, which is clearly wrong.
Hello.
I want to initialize pyflow project from existing Pipfile, however pyflow init
fails even in empty directory. How can I do?
$ mkdir test
$ cd test
$ pyflow init
To get started, run `pyflow new projname` to create a project folder, or `pyflow init` to start a project in this folder. For a list of what you can do, run `pyflow help`.
My environment is as follows.
Regards.
server.py:
__requires__ = ['pywin32']
import win32api
Result:
$ RUST_BACKTRACE=full pyflow script server.py
Please enter the Python version for this project: (eg: 3.8)
3.8
Found multiple compatible Python versions. Please enter the number associated with the one you'd like to use:
1: python3: 3.8.2
2: python: 3.8.2
1
Setting up Python...
Installing pywin32 227.0.0 ...
Traceback (most recent call last):
File "server.py", line 3, in <module>
import win32api
ModuleNotFoundError: No module named 'win32api'
This is for latest version, v0.2.5
P.s. Where is the venv created when using this feature?
P.s.2. Are the __requires__
elements supposed to be quoted? They aren't in the docs, looks strange and will gen syntax errors in IDEs
First of all, thank you for your great work!
I really like its concept.
The Arch User Repositry (AUR) is a community-driven repository for Arch Linux users.
I'm using Manjaro Linux, the Arch based distro, so I made a AUR package for my own use.
Currently I'm using the package locally, but I interested to publish and maintain it.
If it's published, it'll be available through AUR helper like yay, tizen, etc.
Basically it's a kind of APT, Yum or Homebrew for Arch and Arch based distro users. (Technically it's a bit different though.)
Please let me know if it's ok with you.
[tool.pyflow.dependencies]
pywebview = { git = "https://github.com/r0x0r/pywebview" }
❯ pyflow install
thread 'main' panicked at 'Problem parsing Os in extras: openbsd6', src\dep_types.rs:706:49
install_requires = [
...,
'PyQt5 ; sys_platform == "openbsd6"',
]
The point is that I'm running pyflow in Windows.
Given that sys.platform
is built dynamically in most POSIX systems, as are other PEP508's environment markers, I think that a best-effort parsing of install_requires
would be a more resilient approach.
Thank you for your work :) Python is greatly in need of tools like this.
(From #32 (comment))
pyflow new aaa ; cd aaa
pyflow install ufoLib2
-- this will install fonttools[ufo]
fonttools = {version = "^4.2.0", extras = ["ufo", "lxml", "unicode"]}
to the pyproject.toml file.pyflow install
What happened: nothing. What I expected: the lxml
and on Python < 3.8 unicodedata2
dependency are installed in addition to the [ufo]
stuff.
From #11
Installing a package which has an alias, like pyvbox
/virtualbox
, fails with:
Problem getting dependency data: DependencyError { details: "Network error" }
Would improve user experience when downloading and installing.
I suppose this is primarily an issue when you start to have nesting directories and cd
around for some reason. Git and Poetry deal with this correctly. Feel free to close this if it is outside the scope for now or would introduce unwanted complexities about directory traversal.
Currently broken, due to trouble making cross-platform standalone binaries. Discussion of binaries potentially being hosted on Python.org
I'm not sure if this is strictly your problem per se, and I'm unsure if it'd get fixed by waiting and allowing the PEP-582 solution going into python 3.8 and thus hoping VSCode picks it up for detection, but it may be worth posting akin to the poetry project:
I don't know the details of the PEP enough to know if your implementation is "standards compliant" enough that this will eventually filter down anyway.
Food for thought - I expect they'll want a larger userbase and a more mature project before supporting it specially though.
As an aside I'm left in a bit of a pickle now as to what to set the python interpreter too on VSCode to do linting/formatting.
I plan to adopt pyflow early in a production environment despite how young it is simply because it's that good. However I can't seem to be able to even run my project. Here's my (simplified) project structure:
__pypackages__
[...]
myproject
__main__.py
pyproject.toml
Here's what I've tried so far:
pyflow -m myproject
error: Found argument '-m' which wasn't expected, or isn't valid in this context
pyflow myproject
Problem running the CLI tool myproject. Is it installed?
pyflow python -m myproject
error: Found argument '-m' which wasn't expected, or isn't valid in this context
__pypackages__\3.7\.venv\Scripts\activate.bat
followed by python -m myproject
ModuleNotFoundError: No module named 'click'
(main.py tries to import click but it fails.)
I'm out of ideas. Any help is appreciated!
Edit: I've now moved __main__.py
out of myproject
and renamed it to run.py
, and I run it with pyflow run.py
. It would be better if pyflow supported the standardized __main__.py
in some way, though.
I noticed this comment at the bottom of the docs:
You may need to set up IDEs to find packages in
__pypackages__
. If using PyCharm, using the tree on the left, right click__pypackages__/3.x/lib
, select Mark directory as, Sources Root.
I haven't used the tool yet, but I'm assuming that __pypackages__
plays a similar role to the site-packages
directory in a typical virtual environment.
If that's the case, rather than marking the directory as a sources root, I think you'd want to mark it as one of the "Interpreter Paths". Otherwise you'll get atypical search result behavior -- searching in your "Project" will also turn up results in the dependency packages.
(You could still search in the __pypackages__
folder under this approach by selecting it in the "Project" tab before triggering the "Find in Path" action, but if you mark it as a Sources Root I don't think there is an easy way to only search in your actual project.)
To mark a folder as one of the "Interpreter Paths" in PyCharm, you do:
Settings -> Project -> Project Interpreter -> (Settings Cog) -> Show All... -> Select the interpreter -> Click the folder-tree icon at the bottom of the pop-out window -> Click the + icon at the bottom of the new pop-out window -> Navigate to and select the folder you want to add (i.e., __pypackages__
)
Admittedly this is relatively painful, but I think it would give a more typical PyCharm experience with a project structured like this.
(I haven't done it though so I could be wrong! Just figured it might be worth updating the docs if this is right and/or you've noticed any issues with the "Mark as Sources Root" approach.)
Hello!
First issue posted there so tell me if I need to edit its description or title :)
So, I just want to be able to pull dependencies from my own artifactory or any other pypi clone I would own, from custom python builds installation to my own libraries.
I would love to contribute and help you do it if you're ok with it 👍
Thanks for reading.
a.py
:__requires__ = ["fonttools[ufo]"]
import fontTools.ufoLib
pyflow script a.py
thread 'main' panicked at 'Problem opening the Python script file.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
println!
-debugging reveals filename
in main.rs:970 to be "a_py". Looks like someone stepped on the dot.
Standard Windows venv seems to be set up in .venv
, but then packages seem to be installed in lib/
, as if it detects a non-windows environment.
Could pyflow adopt Linux style venv paths on windows i.e. bin/
instead of Scripts/
, lib
instead of Lib
etc. Not sure what the history for this difference is on windows.
Since pyflow.exe is 64bit only (AFAIK?) it should probably only have a architecture.64bit
key in the scoop json manifest as per the scoop spec.
Or leave everything as is and just build a 32bit version going forward, I doubt there are any perf benefits that justify the slightly larger binary size?
For reference pyflow.exe v0.2.5.1 returns exit code 216 on windows 7 32bit.
Involves contributing a JSON file to scoop repo describing where to get release binary by version etc
If there's demand, I'll build them with each release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.