Remove packages from local pypi index - setuptools

This is similar to this question with one exception. I want to remove a few specific versions of the package from our local pypi index, which I had uploaded with the following command in the past.
python setup.py sdist upload -r <index_name>
Any ideas?

As an addenum from #jan-vlcinsky's answer
Removing from pypiserver
Using curl for instance:
curl --form ":action=remove_pkg" --form "name=<package_name>" --form "version=<version>" <pypiserver_url>

Removing packages from local pypi index depends on type of pypi index you use.
removing package from devpi index
devpi allows removing packages only from so called volatile indexes. Non-volatile are "release like" indexes and removing from them is not allowed (as you would surprise users depending on released package).
E.g. for package pysober version 0.2.0:
$ devpi remove -y pysober==0.2.0
removing package from public pypi
is described in the answer you already refered to.
removing package from other indexes
Can vary, but in many cases you can manually delete the files (with proper care).

I'm using pypiserver and had to remove a bad package so I just SSH'd in and removed the bad packages and restarted the service.
The commands were roughly:
ssh root#pypiserver
cd ~pypiserver/pypiserver/packages
rm bad-package*
systemctl restart pypiserver.service
That seemed to work fine for me, and you can just remove what you need using standard shell commands. Just be sure to restart the process so it refreshes its index.

Related

Conda: How to install latest version of `pandoc-crossref` from Github in `conda` environment?

pandoc-crossref must match the pandoc version, and also only the 3.10.0 release works on OSX Big Sur. Thus, it is not possible to get pandoc and pandoc-crossref running in a conda environment from the official channel or from conda-forge.
I could easily download the matching binaries from https://github.com/lierdakil/pandoc-crossref/releases/tag/v0.3.10.0 and copy them e.g. to the binpath:
$ which pandoc-crossref
/usr/local/bin/pandoc-crossref
$ curl -OL https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.10.0/pandoc-crossref-macOS.tar.xz
$ tar -xzvf pandoc-crossref-macOS.tar.xz
$ mv pandoc-crossref /usr/local/bin/pandoc-crossref
But I think that is not a clean approach, because conda will not know that I updated the version for pandoc-crossref.
What is a clean approach for updating a package managed by conda from a binary available on Github?
Update Feedstock
I updated it on the Conda Forge feedstock, which is what I regard as the "cleanest" solution.
How does one do that? First, OP had posted a comment on the feedstock in the PR that they wanted merged. This was the appropriate first step and hopefully in future cases that should be sufficient to prompt maintainers to act. In this case, it was not sufficient. So, as a follow up, I chatted on the Conda Forge Gitter to point out that the feedstock had gone stale and had non-responding maintainer(s). One of the core Conda Forge members suggested I make a PR bumping the version and adding myself as maintainer, and they merged it for me. In all, this took about 10 mins of work and ~2 hours from start to having an updated package on Anaconda Cloud.
Custom Conda Build
Otherwise, there isn't really a clean solution for non-Python packages outside of building a Conda package. That is, clone the feedstock or write a new recipe, modify it to build from the GitHub reference, then install that build into your environment. It may also be worth uploading to an Anaconda Cloud user account, so there is some non-local reference for it.
Pip Install (Python Packages Only)
In the special case that it is a Python package, one could dump the environment to YAML, edit to install the package through pip, then recreate the environment.

How can I remove crouton targets?

I have installed multiple targets to test them all and now I would like to remove some that are not working well with xenial. There's no information on the crouton github wiki on how to remove targets, only how to install and update them. What command should I use to remove targets?
Should I just edit the file /etc/crouton/targets within my chroot and then remove packages like kde?
Thanks!
There is no builtin way to do this - just as you said remove it from the /etc/crouton/targets and then you have to manually delete the packages themselves. To do this you should do just:
sudo apt-get remove <comma,sep,list,packages>
(or apt-get purge) It means you need to know these though.

How to manually install a package in racket?

How can I manually install a package in racket (that is without relying on raco)? Is that possible?
I installed the minimal racket distribution and want to manually add the packages in question (such as xrepl which doesn't seem to come by default).
I'm on CentOS and I have no root privileges (the installation is in a private directory).
Although I'm not sure I understand the permissions issue you're having, you could try raco pkg install --scope user.
Anyway, you can use raco pkg install --link <dir> to install locally. (Just like what people do when they're developing a package locally.)
So for example:
cd ~/src
git clone path/to/foo
(Or get the package source into ~/src/foo some other way. By "package source" I mean there should be an info.rkt in ~/src/foo.)
raco pkg install --link foo
If the foo package has any dependencies, than raco pkg install will offer to get and install them, too. Normally this would be handy. But since you're having connection or permission problems, I imagine you'll want to answer No. Instead, do this manual install for each of the deps, then retry this one. (Obviously if there are many deps, this is inconvenient, which is one of the benefits of using a package manager when you are able to.)

Why can't I cabal install --only-dependencies with mongodb?

I have gone through the following steps:
$ mkdir mongoEg
$ cd mongoEg
$ cabal init
...
Configured to run as an executable. I add mongodb to the build-depends list. I make a dummy Main.hs file and put a basic hello world in there. I then do
$ cabal sandbox init
$ cabal install --only-dependencies
Which responds with:
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: monogEg-0.1.0.0 (user goal)
next goal: mongodb (dependency of monogEg-0.1.0.0)
Dependency tree exhaustively searched.
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
I read up on other problems people are having, and remove ~/.ghc, remove my mongoEg directory, and repeat to get the same results. I try to run through the analogous steps at http://howistart.org/posts/haskell/1 and find that everything works just fine.
I then guess that something is wrong with the mongodb package itself. I seem to be able to cabal install mongodb in a global environment and use it outside of a sandbox without any issue. So, why wont cabal sandboxes play with the mongodb package?
See this gist for details: https://gist.github.com/anonymous/e5a548cf7d9ec59bea31
After looking here
Cabal configure in a sandbox complains "At least the following dependencies are missing" on installed packages
I saw that the answer states that package names are case sensitive. So I tried changing mongodb to the way MongoDB spells it, namely MongoDB. This did not work, so I tried changing it to mongoDB, and finally there was joy.
So even though I can do cabal install mongodb I can't use that same spelling to install it from within a .cabal file, which is, obviously, completely stupid. I'm sure I'll find the right place to channel my rage about this kind of flagrant violation of the principle of least surprise, but for now I can say that to newcomers it is most needlessly confusing.

Download RPMs for all dependencies for package using yum

I'm attempting to create a local yum repo on my system containing various packages from, chiefly, the CentOS base repos. The server which is hosting the yum repo will not necessarily have the same base packages installed by default as the servers which will be using the yum repo. For this reason, I need to ensure that my repos contain the packages that I want and every single one of their dependencies.
I'm creating my repos using the yumdownloader tool provided in the yum-utils package to try to download an RPM file for a package using yum from the standard CentOS mirrors. Helpfully it provides a command line option, --resolve, which also downloads dependencies. However, because it's built on yum itself, yumdownloader will only download dependencies for the package that are not already present on the system.
For example, I wish to download package A, which depends on Packages B, C and D. If package D is already installed on the system, yumdownloader --resolve A will only download A, B and C, but not D.
Is there a way to download the RPMs for all dependencies on a package from a yum repo?
There's this bash script, which the maintainer of rpm has kindly shared with me, and I put on github. Hope you find it useful!
You can also read the original SO question, where the issue was discussed.
The script works on Fedora 23+ as it uses dnf's download plugin. It's probably very easy to make it work on Fedora 22-, as yum surely has got a similar plugin.
Additionaly, it's valuable since repotrack does not work on fedora 23 (at least it doesn't work for me).
After a lot of frustration looking around for a solution I have written a simple script that uses repotrace and wget. I've found that yumdownloader (even with the resolve flag) does not resolve all dependencies.
if you have a long list of packages you are bound to run into duplicates, downloading just the urls first with the "repotrack -u flag" and then getting unique records resolves having to download the same rpm multiple times.
#!/bin/bash
while read i; do
repotrack -u $i >> dep_rpm_urls_02.txt
done < list_of_packages_01.txt
awk '!seen[$0]++' dep_rpm_urls_02.txt > dep_rpm_urls_clean_03.txt
while read j; do
wget $j
echo dowloaded $j
done < dep_rpm_urls_clean_03.txt
happy rpming