Re: PIP Package Building for pgAdmin4

Поиск
Список
Период
Сортировка
От Muhammad Aqeel
Тема Re: PIP Package Building for pgAdmin4
Дата
Msg-id CAJ4pYuxmUuMgpN=zT_xBRaF6BD3RRDCp+4q=_HT1i5b1j1qmqA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PIP Package Building for pgAdmin4  (Dave Page <dpage@pgadmin.org>)
Ответы Re: PIP Package Building for pgAdmin4  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Hi Dave,

On Mon, Mar 14, 2016 at 7:06 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Mon, Mar 14, 2016 at 1:46 PM, Muhammad Aqeel
<muhammad.aqeel@enterprisedb.com> wrote:
> Hi Dave,
>
> I tested the build after your commit. There were minor bugs in your changes
> which prevented the packaging of pgadmin4 sources.
>
> - It needed a space after * in recursive include statement of manifest.in
> - \n is not interpreted as new line.
>
> I fixed both issues in attached patch and tested the build. It is working
> fine now and pgadmin4.egg-info/SOURCES.txt showing no .pyc file and
> pgadmin4.db file in it.

Weird - as discussed, I tested it thoroughly before committing and it
works fine.

PFA the new patch which contains following changes.

- It just replaces the @echo to @printf in your changed line to fix the issue. I tested it on both Linux and OSX. It is working fine. 

- In your commit you had changed 'PGADMIN_DIST = dist' to 'PGADMIN_DIST = build'. dist directory is generated by pip setuptools to have generated wheel file so it is needed. I made it again 'PGADMIN_DIST = dist'. If you don't want to remove it in clean-pip target then you can remove the rm command from clean-pip target.

- In case user runs make twice without cleaning the source it was copying the web directory to existing pgadmin4 source directory. I fixed this issue too.


Testing with this patch though, I see the original problem (and also,
so warnings - can you check them please)?

(pgadmin4)piranha:pgAdmin4 dpage$ git reset --hard
HEAD is now at dc64160 Add a top level Makefile with a target and
appropriate Python stuff to build a PIP package of the web code.
(pgadmin4)piranha:pgAdmin4 dpage$ make pip 1> /dev/null
/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/setuptools/dist.py:285:
UserWarning: Normalizing '1.0.0-dev' to '1.0.0.dev0'
  normalized_version,

It is an issue with PEP440 which interprets version as integer and if sees any string in it, it tries to normalise it. Here is the link which explains it.


It is coming with Python 2.6 only. With Python 2.7 and above it is not there.
 
package init file 'pgadmin4/__init__.py' not found (or not a regular file)

This is because in web directory we don't have __init__.py file.
 
warning: manifest_maker: standard file 'setup_pip.py' not found

setuptools by default look for setup_pip.py file in current directory. Since we placed this file in pkg/pip (according to your suggestion) this warning is coming.
 

warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

I have not faced this issue but following link suggests a solution for it.


It says "Setting export VIRTUALENV_USE_DISTRIBUTE=1 fixed the problem." 


(pgadmin4)piranha:pgAdmin4 dpage$ grep pgadmin4.db
pgadmin4.egg-info/SOURCES.txt |wc -l
       0
(pgadmin4)piranha:pgAdmin4 dpage$ grep pyc pgadmin4.egg-info/SOURCES.txt |wc -l
       0
(pgadmin4)piranha:pgAdmin4 dpage$ git apply ~/Downloads/manifest_bug_fix.patch
(pgadmin4)piranha:pgAdmin4 dpage$ make pip 1> /dev/null
/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/setuptools/dist.py:285:
UserWarning: Normalizing '1.0.0-dev' to '1.0.0.dev0'
  normalized_version,
package init file 'pgadmin4/__init__.py' not found (or not a regular file)
warning: manifest_maker: standard file 'setup_pip.py' not found

warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

(pgadmin4)piranha:pgAdmin4 dpage$ grep pgadmin4.db
pgadmin4.egg-info/SOURCES.txt |wc -l
       1
(pgadmin4)piranha:pgAdmin4 dpage$ grep pyc pgadmin4.egg-info/SOURCES.txt |wc -l
      84

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: PIP Package Building for pgAdmin4
Следующее
От: Lev Lazinskiy
Дата:
Сообщение: Adding to Documentation