Comments (20)
Try pip install --user -U pip
before you call fpm
(you need pip>8 for proper PyPI handling). At least on Xenial creating a DEB shows no problems, and creates this for dependencies:
Depends: python-pgspecial (>= 1.8.0), python-click (>= 4.1), python-pygments (>= 2.0),
python-prompt-toolkit (>= 1.0.10), python-prompt-toolkit (<< 1.1.0), python-psycopg2 (>= 2.5.4),
python-sqlparse (<< 0.3.0), python-sqlparse (>= 0.2.2), python-configobj (>= 5.0.6),
python-humanize (>= 0.5.1), python-wcwidth (>= 0.1.6), python-setproctitle (>= 1.1.9)
from pgcli.
If you need more people working on this, let me know.
from pgcli.
Feel free to start on it, I'm likely going to be a little while before I
can get started.
On Jan 9, 2015 6:31 AM, "Dionysis Grigoropoulos" [email protected]
wrote:
If you need more people working on this, let me know.
β
Reply to this email directly or view it on GitHub
#70 (comment).
from pgcli.
π
from pgcli.
@amjith Is this still an issue? I can help on this one.
I have some experience in it: https://github.com/sobolevn/git-secret/blob/master/Makefile#L111
from pgcli.
@sobolevn I'd welcome any help. This is not a solved problem. Thank you for your help.
from pgcli.
Isn't is solved via https://github.com/dbcli/pgcli/blob/master/Vagrantfile#L79 ?
DEVELOP.rst
also says that there's a way to create RPM: https://github.com/dbcli/pgcli/blob/master/DEVELOP.rst#building-rpm-and-deb-packages
from pgcli.
That didn't work out as I expected. When I created an RPM package it wouldn't install inside a test Centos container. I think there was some problem with assuming that some files existed or hardcoded path.
from pgcli.
I should probably remove that file and update the docs.
from pgcli.
Ok, I have managed to run it. But there's an issue with prompt_toolkit
.
Environment
I have used this docker-image: https://hub.docker.com/r/sobolevn/git-secret with fedora-latest
tag.
[root@30722cfb4b5b code]# yum install -y python python-devel postgresql postgresql-server postgresql-devel createrepo
Preparation
[root@bc3d887d95d3 code]# gem install fpm
Fetching: fpm-1.6.3.gem (100%)
Successfully installed fpm-1.6.3
Parsing documentation for fpm-1.6.3
Installing ri documentation for fpm-1.6.3
Done installing documentation for fpm after 1 seconds
1 gem installed
Dependencies
[root@30722cfb4b5b pgcli]# pip install .
[root@30722cfb4b5b pgcli]# pip uninstall -y pgcli prompt-toolkit # fixing the prompt-toolkit bug
[root@30722cfb4b5b pgcli]# mkdir repo && cd repo
[root@30722cfb4b5b repo]# pip freeze | xargs -n1 fpm -s python -t rpm --python-pip pip
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Created package {:path=>"python-click-6.6-1.noarch.rpm"}
Created package {:path=>"python-configobj-5.0.6-1.noarch.rpm"}
Created package {:path=>"python-humanize-0.5.1-1.noarch.rpm"}
Created package {:path=>"python-iniparse-0.4-1.noarch.rpm"}
Created package {:path=>"python-pgspecial-1.6.0-1.noarch.rpm"}
Created package {:path=>"python-psycopg2-2.6.2-1.x86_64.rpm"}
Created package {:path=>"python-pygments-2.1.3-1.noarch.rpm"}
Created package {:path=>"python-setproctitle-1.1.10-1.x86_64.rpm"}
Created package {:path=>"python-six-1.10.0-1.noarch.rpm"}
Created package {:path=>"python-sqlparse-0.2.1-1.noarch.rpm"}
Created package {:path=>"python-wcwidth-0.1.7-1.noarch.rpm"}
Package creation
At this point due to some kind of bug (possibly jordansissel/fpm#65) I had to comment out the line # 'prompt_toolkit>=1.0.0,<1.1.0',
. Another option is to provide all the deps by hand with --no-auto-depends
flag. I will also create a separate bug report for it.
[root@30722cfb4b5b repo]# fpm -s python -t rpm --after-install ../post-install --after-remove ../post-remove -d python-devel -d postgresql-devel -d python2-prompt_toolkit --python-pip pip ../setup.py
Created package {:path=>"python-pgcli-1.2.0-1.noarch.rpm"}
Creating repo
I was just following the steps from http://stackoverflow.com/questions/13876875/how-to-make-rpm-auto-install-dependencies I have also provided these options to disable caching: metadata_expire=1 mirrorlist_expire=1
[root@30722cfb4b5b repo]# createrepo .
Spawning worker 0 with 6 pkgs
Spawning worker 1 with 6 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
Package information
[root@30722cfb4b5b repo]# rpm -qip python-pgcli-1.2.0-1.noarch.rpm
Name : python-pgcli
Version : 1.2.0
Release : 1
Architecture: noarch
Install Date: (not installed)
Group : default
Size : 391133
License : LICENSE.txt
Signature : (none)
Source RPM : python-pgcli-1.2.0-1.src.rpm
Build Date : Sat Oct 8 10:01:23 2016
Build Host : 30722cfb4b5b
Relocations : /
Packager : @30722cfb4b5b
Vendor : none
URL : http://pgcli.com
Summary : CLI for Postgres Database. With auto-completion and syntax highlighting.
Description :
CLI for Postgres Database. With auto-completion and syntax highlighting.
Checking for deps
[root@30722cfb4b5b repo]# rpm -qRp python-pgcli-1.2.0-1.noarch.rpm
/bin/sh
/bin/sh
postgresql-devel
python-click >= 4.1
python-configobj >= 5.0.6
python-devel
python-humanize >= 0.5.1
python-pgspecial >= 1.6.0
python-psycopg2 >= 2.5.4
python-pygments >= 2.0
python-setproctitle >= 1.1.9
python-sqlparse >= 0.2.0
python-sqlparse < 0.3.0
python-wcwidth >= 0.1.6
python2-prompt_toolkit
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Testing
[root@30722cfb4b5b repo]# yum install python-pgcli
Redirecting to '/usr/bin/dnf install python-pgcli' (see 'man yum2dnf')My Awesome Repo 3.0 MB/s | 6.9 kB 00:00
Dependencies resolved.
...
Running:
[root@30722cfb4b5b repo]# pgcli
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
from pgcli.
Sorry about the delayed response. I've run into issues with psycopg2 when I generated an rpm with the fpm package.
Something about the python-dev package and not having the right requirement for it.
from pgcli.
Any update on this?
We'd really like to have it properly packaged for os-wide version control and for deployment to servers that we don't want to install pip on.
I made a quick and dirty package for CentOS 7 using fpm
fpm -s python -t rpm --python-pip pip pgcli
python-pgcli-1.7.0-1.noarch.rpm.zip
And for Debian 8/9:
fpm -s python -t deb --python-pip pip pgcli
python-pgcli_1.7.0_all.deb.zip
from pgcli.
@sammcj I've search at https://bugzilla.redhat.com/ but there's no request for it (yet). I'll have a look if I can use the mysql package as a template for a pgcli package.
Maybe I can combine this with my attempt to get mycli in EPEL (CentOS repository).
from pgcli.
from pgcli.
Or bintray
from pgcli.
Thanks, those are great suggestions, but I'm using the .spec files from the RPMs which are already in Fedora so I think I should keep it at RedHat. Fedora has COPR where everyone can host/build RPMs, I'm already using that for a EPEL mycli repository.
from pgcli.
@meeuw Is this now addressed? Can we close this?
from pgcli.
nope, haven't finished this
from pgcli.
Does anyone want help landing this? Is there any partial work to land?
A friend pointed out your request for assistance on your main page. I've spent most of the last few months doing packaging a python application. I'm happy to help if help is still desired.
from pgcli.
Hi @chicks-net! Thanks for offering your help!
I've submitted it as a package for Fedora but it isn't accepted (and I don't see any progress). I need a supporter from Red Hat / Fedora to be accepted as a packager.
https://bugzilla.redhat.com/show_bug.cgi?id=1570551
I'm not sure for what OS you'd like to have a package but I have created copr packages here:
https://copr.fedorainfracloud.org/coprs/meeuw/pgcli/
from pgcli.
Related Issues (20)
- sql-insert format emits NULL as 'None' HOT 3
- The query result is messed up in Chinese HOT 2
- Autocomplete offers no columns after one column named 'type' HOT 2
- Not working on windows 11 HOT 12
- \d+ doesn't show options of a table while psql does HOT 1
- How to change default key bindings / hotkeys or assign new bindings HOT 4
- syntax error at or near "$" in parameter aggregation in named queries HOT 2
- Is it ok to add pgcli as 1password shell plugin? HOT 4
- Enhancement suggestion: inverted SELECT statements HOT 1
- Support `PGAPPNAME` for setting `application_name` HOT 1
- Connecting via unix socket on a specific DB crashes pgcli HOT 3
- pgcli disconnects when closing pager with `q` HOT 5
- Output to file in addition to the pager?
- Named Queries more user firendly
- [feature request] Unicode table HOT 1
- Using environment variables to connect via ssh HOT 2
- pgcli 4.0 - ModuleNotFoundError: No module named 'six' HOT 7
- pgcli.magic `conn.session.engine.url` raises AttributeError after breaking change upstream in ipython-sql
- Raised notices are printed backwards HOT 3
- Segfault on MacOs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgcli.