Does entry_points declared using [tool.poetry.dependencies] are supposed to be available in "sub-projects" - python-poetry

Let's say I have a project foo with:
[tools.poetry.scripts]
foo-cli = 'foo:main'
and a project bar with:
[tool.poetry.dependencies]
python = "^3.7"
bar = {path = "../foo"}
Is foo-cli supposed to be available in a virtualenv where bar is installed using poetry install (seems to not be the case so far) ?

My project was started using an older version of poetry, remove and recreate the virtual envs fixed the issue.

Related

Trying to Avoid Using Two Package Managers (pip and Poetry) for the Same Project

After a fair bit of thrashing, I successfully installed the Python Camelot PDF table extraction tool (https://pypi.org/project/camelot-py/) and it works for the intended purpose. But in order to get it to work, aside from having to correct a deprecated dependency (by editing pyproject.toml and setting PyPDF2 =”2.12.1”) I used pip to install Camelot from within a Poetry (my preferred package manager) environment- because I haven’t yet figured out any other way.
Since I’m very new to Python and package management (but not to programming) I have some holes in my basic understanding that I need to patch up. I thought that using two package managers on the same project in principle defeats the purpose of using package managers, so I feel like I’m lucky that it works. Would love some input on what I’m missing.
The documentation for Camelot provides instructions for installing via pip and conda (https://camelot-py.readthedocs.io/en/master/user/install-deps.html), but not Poetry. As I understand (or misunderstand) it, packages are added to Poetry environments via the pyproject.toml file and then calling "poetry install."
I updated pyrpoject.toml as follows, having identified the current Camelot version as 0.10.1 (camelot --version):
[tool.poetry.dependencies]
python = "^3.8"
PyPDF2 = "2.12.1"
camelot = "^0.9.0"
This led to the error:
Because camelot3 depends on camelot (^0.9.0) which doesn't match any versions, version solving failed.
Same problem if I set (camelot = "0.10.1"). So I took the Camelot reference out of pyproject.toml, and ran the following command from within my Poetry virtual environment:
pip install “camelot-py[base]”
I was able to successfully proceed from here, but that doesn’t feel right. Is it wrong to try to force this project into Poetry, and should I instead consider using different package managers for different projects? Am I misunderstanding how Poetry works? What else am I missing here?
Whenever you see pip install 'Something[extra]' you can replace it with poetry add 'Something[extra]'.
Alternatively you can write it directly in the pyproject.toml and then run poetry install instead:
[tool.poetry.dependencies]
# ...
Something = { extras = ["extra"] }
Note that in your question you wrote camelot in the pyproject.toml but it is camelot-py that you should have written.

Update dev dependencies using Poetry >1.20

In my pyproject.toml I have some dev dependencies configured as follows:
[tool.poetry.group.dev.dependencies]
mypy = "^0.971"
A simple poetry show -l shows that I indeed have mypy installed with version 0.971. Currently, the latest version available is v0.991.
What's the correct syntax to have all my dependencies - including dev dependencies - being updated.
poetry update --with=dev is not going to update mypy to the latest version.
poetry update updates dependencies within the version range given in the pyproject.toml.
^0.971 translates to >=0.971,<0.972 (See: https://python-poetry.org/docs/dependency-specification/#caret-requirements). This is why poetry update will not update mypy to 0.991.
To get the latest version of a dependency you have to use poetry add <dep>#latest. In your case poetry add -G dev mypy#latest.
At the moment there is no Poetry command to bump all dependencies to its latest version outside of the given version ranges. But there is a feature request for it: https://github.com/python-poetry/poetry/issues/461

Installing xv6 on macOS

I'm trying to install the xv6 OS on my macOS (version 10.14.3) following the instructions of this site, only with the newest versions of the needed files and when I'm getting at the binutils configuration stage I'm getting from my terminal:
Config.guess failed to determine the host type. You need to specify one.
Usage: configure [OPTIONS] [HOST]
Options: [defaults in brackets]
--prefix=MYDIR install into MYDIR [/usr/local]
--exec-prefix=MYDIR install host-dependent files into MYDIR[/usr/local]
--help print this message [normal config]
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [determined via config.guess]
--norecursion configure this directory only [recurse]
--program-prefix=FOO prepend FOO to installed program names [""]
--program-suffix=FOO append FOO to installed program names [""]
--program-transform-name=P transform installed names by sed pattern P [""]
--site=SITE configure with site-specific makefile for SITE
--srcdir=DIR find the sources in DIR [. or ..]
--target=TARGET configure for TARGET [TARGET=HOST]
--tmpdir=TMPDIR create temporary files in TMPDIR [/tmp]
--nfp configure for software floating point [hard float]
--with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)
--without-FOO package FOO is NOT available
--enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)
--disable-FOO do not include feature FOO
Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.
What can I do to solve it? does anyone have better and validated instruction for installing xv6 on macOS? (I've also tried this website and it didn't work of course.)
all I needed to do is:
Install xCode and agree the terms of use.
Download xv6 from https://github.com/mit-pdos/xv6-public.
Install MacPorts from https://www.macports.org/.
Open a terminal window where I downloaded the OS.
Install Qemu by writing sudo port install qemu.
sudo port install i386-elf-gcc gdb.
Replace the existing Makefile to a new one.
In order to run, write in the terminal window make qemu clean.

How can I update bootstrap version in Compass.app?

I'm using Compass.app GUI application on windows. By default I am having options to create new project with bootstrap-sass 3.2.0.1. How can i update this to bootstrap-sass 3.3.6?
You just need to put bootstrap-sass-3.3.6 folder in:
Windows:
compass.app/lib/ruby/compass_extensions
OSX:
compass.app/Contents/Resources/lib/ruby/compass_extensions
Compass will look automatically for the highest available version, you can leave previous version in compass folder.

How to require node modules correctly in node.exe of node.js

Recently there is a newer version of node.js which supports npm for windows.
I followed the instructions here
And i've installed socket.io successfully on windows through npm (though some failed, like JSDOM)
However when I require the module the followings fails:
var io = require("socket.io").listen(1234);
and also
var io = require("./lib/node_modules/socket.io/index.js").listen(1234);
Which shows "Cannot find module "socket.io"
However this works:
var io = require('/NodeDev/lib/node_modules/socket.io/index.js').listen(1234);
Here is where my stuff are placed:
folder socket.io : in D:\NodeDev\lib\node_modules\
node.exe : in D:\NodeDev\bin\
my script : in D:\NodeDev\TestProject\
I had a similar problem when dealing with generally available packages in Windows. It worked when I installed the packages directly into my project:
cd myProject
npm install socket.io
It then gets installed into the myProject/node_modules folder. At that time, doing a require('socket.io') works for me.

Resources