Poetry takes ages to update dependencies - python-poetry

Yesterday I've commanded poetry to add new dependency. I'm still waiting...
$ poetry add readability
Using version ^0.3.1 for readability
Updating dependencies
Resolving dependencies... (66408.9s)
Is there any way to fix that or manually update lock?

First run:
poetry cache clear pypi --all
Then run:
poetry lock

Related

Python Poetry - update -dev dependencies only to latest

How do I get Poetry to update dev dependencies only to latest?
I originally had:
[tool.poetry.dev-dependencies]
pytest = "^4.6"
But I wanted:
[tool.poetry.dev-dependencies]
pytest = "^6.0"
I achieved it by manual editing the pyproject.toml file.
When I ran poetry update it ( brilliantly ) bumped all my normal ( non-dev ) dependencies.
This is the command I wanted:
poetry add pytest#latest --dev
With latest poetry version you should use
poetry add pytest#latest --group dev

Poetry gives: `TooManyIndirects` error suddenly

I have a pyproject.toml:
...
[[tool.poetry.source]]
name = "REPO_NAME"
url = "https://gitlab.com/SOME_ADDRESS"
secondary = true
When trying to install the project using poetry
(poetry install/poetry update) i get:
Updating dependencies Resolving dependencies... (14.3s)
TooManyRedirects
Exceeded 30 redirects.
Currently pypi.python.org is having an issue and there is nothing one can do about it:
But hey, it's Friday.
Clearing the cache seemed to do the trick:
poetry cache clear --all REPO_NAME
Also, it could happen on global PYPI, in that case run:
poetry cache clear --all pypi
To list all poetry's repos:
poetry cache list
There has been an issue with PyPI Json endpoints that poetry uses. pip was unaffected because it uses different endpoints.
A workaround is to export poetry dependencies to the requirements.txt format and use pip:
poetry export --dev > requirements.txt && pip install -r requirements.txt

Install packages partially in package.json?

I need to run a script that requires only a few packages in package.json. But yarn install command installs all packages with a lot of time. Is there any solution to install partially I want to install?

Error: uninitialized constant FFI::Platform::CPU on starting jekyll server

I got the below error on trying to start Jekyll server
Error: uninitialized constant FFI::Platform::CPU
I tried reinstalling Jekyll server and its dependencies, but no luck. Could someone help me to get around this issue? Thanks.
I am using ubuntu=18.04, jekyll=3.8.6
anil#anil:~/customer-churn$ jekyll serve
Configuration file:
~/customer-churn/_config.yml
Source: ~/customer-churn
Destination: ~/customer-churn/_site
Incremental build: disabled. Enable with --incremental
Generating... done in 0.597 seconds.
jekyll 3.8.6 |
Error: uninitialized constant FFI::Platform::CPU
I guess this problem occurs if you've installed Jekyll through apt. In that case a bundle update won't work immediately after an apt remove. Try the following approach:
Uninstall Jekyll first:
sudo apt remove jekyll*
Clean-up your dependency libs:
sudo apt autoremove
Then in your project directory run:
bundle update
Positively, then jekyll serve should work for you.
I solved the problem by reinstalling the Jekyll and its dependencies using some steps which are given in the below link -
http://michaelchelen.net/81fa/install-jekyll-2-ubuntu-14-04/
I just want to thanks all who have to help and giving guidance to me from your busy schedule.
I was not able to solve this simply by running bundle update or reinstalling jekyll and dependencies with apt as other answers suggested.
What did work was to
remove all versions of jekyll and dependencies with sudo gem uninstall ...,
remove jekyll and all dependencies with apt-get remove ...,
then reinstall jekyll and dependencies with apt-get install ...,
and then run bundle update in the project directory.
Then only bundle exec jekyll serve works, and jekyll build still presents the same error.
Try removing Jekyll using apt (if you've installed it that way):
sudo apt remove jekyll*
Then go to your project, type:
bundle update
and only then:
jekyll serve
Found this answer here:
https://www.gitmemory.com/issue/jekyll/jekyll/7712/502572155
I ran into the same problem. After running bundle exec jekyll serve --trace, I noticed that some packages were being loaded from the /usr/lib/ruby/vendor_ruby directory. So, I removed the /usr/lib/ruby/vendor_ruby directory (keeping a backup copy of it in my home directory, just in case). This, followed by bundle install, fixed the issue for me.

How to find and treat the cause of an outdated composer package that is not in my composer.json?

I ran composer outdated command:
$ composer outdated
phpdocumentor/type-resolver 0.4.0 0.7.1
but looking inside composer.json, I see no such package. In my case there is no type-resolver.
How do I find an outdated package that is missing in composer.json belongs to and how do I update it?
Composer install not only packages that are listed directly in composer.json but also packages that are dependencies of packages that are listed in composer.json. Assuming you have in composer package vendor/A and this package requires vendor/B you will have installed both A and B packages.
So in your case you can run:
composer update phpdocumentor/type-resolver
to try to update this package.
Of course it does not mean it will be possible to update this way. It's possible that you might need to run:
composer update
but this will update all packages (and depends on scenario this is what you can accept or maybe you don't want to update all packages).
It's also possible that it won't be possible to update this package because other package that is used has phpdocumentor/type-resolver dependency set to for example 0.4.* so 0.7 version is not compatible with this package and version 0.7 won't be installed

Resources