[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Help needed for eric6 development - support setup.py
From:       Barry Scott <barry () barrys-emacs ! org>
Date:       2019-04-16 19:55:41
Message-ID: F4C371B0-263D-4DDB-9D94-33261496AA2B () barrys-emacs ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 16 Apr 2019, at 17:45, Detlev Offenbach <detlev@die-offenbachs.de> wrote:
> 
> Hello Grzegorz,
> 
> the VERSION file was meant to be created by a build script. Meanwhile I 
> implemented something different. The idea with the 'build_py' is interesting. 
> There are some other files that need processing and potentially reverting this 
> change. Is there another command, that is called at the end of the build? 
> Maybe there is some documentation that explains, which commands are called in 
> which order. I intend to call it like

Just add the VERSION file in the MANIFEST.in file and it will then be in the source \
.tar.gz. I also use a file to hold the version, version.txt.

I use the following to build the xml-prefernences wheels.

----
#!/bin/bash
rm -rf  build
rm -rf  dist
rm -rf  xml-preferences.egg-info

python3 setup.py sdist bdist_wheel "$@"

ls -1 dist/*.whl
-----


> 
> python3 setup.py bdist_wheel
> 
> Another observation I made is, that "pip install eric6.whl" does not execute 
> the 'install_data' or a 'install' command. Any suggestion for that?

You can always do any one time setup the first time your code runs.

Barry


> 
> Detlev
> 
> Am Montag, 15. April 2019, 22:43:24 CEST schrieb Grzegorz Bokota:
> > there is no VERSION file in the repository.
> > I also suggestto store __version__ varable in __init__.py of eric. The
> > allows to check it form imported lib.
> > Some code like:
> > 
> > def read(*parts):
> > with codecs.open(os.path.join(current_dir, *parts), 'r') as fp:
> > return fp.read()
> > 
> > 
> > def find_version(*file_paths):
> > version_file = read(*file_paths)
> > version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
> > version_file, re.M)
> > if version_match:
> > return version_match.group(1)
> > raise RuntimeError("Unable to find version string.")
> > 
> > 
> > You put in one file
> > 
> > python_requires=">=3.5",
> > 
> > and
> > 
> > "Programming Language :: Python :: 2.7",
> > 
> > I add few fixes to setup.py to build ui files during build phase (lines
> > 96-118). Now, on my computer, it builds (When add VERSION file) and can be
> > installed with pip install ./eric6.
> > 
> > I do not use eric earler so i do not know how to test it.
> > I got warnings like  Warning: translation file 'qscintilla_pl_PL'could not
> > be loaded. on startup.
> > 
> > pon., 15 kwi 2019 o 18:43 Detlev Offenbach <detlev@die-offenbachs.de>
> > 
> > napisał(a):
> > > Thanks Barry. Every example is useful.
> > > 
> > > Detlev
> > > 
> > > Am Sonntag, 14. April 2019, 22:52:46 CEST schrieb Barry:
> > > > > On 14 Apr 2019, at 18:36, Detlev Offenbach <detlev@die-offenbachs.de>
> > > > > wrote:
> > > > > 
> > > > > Hello all,
> > > > > 
> > > > > I would like to support distribution of eric6 via PyPI. This requires
> > > 
> > > it
> > > 
> > > > > to be packaged as a wheel via setuptools and a setup.py file.
> > > > > Unfortunately I am not familiar with this task. Nevertheless, I
> > > > > reorganized the eric 6 source tree and created a first setup.py file
> > > 
> > > and
> > > 
> > > > > packed everything into the 'setup.py' branch of the eric repository.
> > > > > 
> > > > > Help with the setup.py file would be much appreciated. Please send
> > > > > patches/
> > > > > suggestions/tips, simply everything that makes this task done to me or
> > > > > these mailing lists.
> > > > 
> > > > If your code is pure python it should be easy enough to package.
> > > > 
> > > > Is this example usedul?
> > > > https://github.com/barry-scott/PythonWinAppPackager/blob/master/setup.py
> > > > 
> > > > Barry
> > > > 
> > > > > Regards,
> > > > > Detlev
> > > > > 
> > > > > PS: Who to checkout the repository is explained on the eric web site
> > > > > (https:// eric-ide.python-projects.org).
> > > 
> > > --
> > > Detlev Offenbach
> > > detlev@die-offenbachs.de
> > > 
> > > 
> > > _______________________________________________
> > > PyQt mailing list    PyQt@riverbankcomputing.com
> > > https://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> -- 
> Detlev Offenbach
> detlev@die-offenbachs.de <mailto:detlev@die-offenbachs.de>
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com \
> <mailto:PyQt@riverbankcomputing.com> \
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt \
> <https://www.riverbankcomputing.com/mailman/listinfo/pyqt>


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote \
type="cite" class=""><div class="">On 16 Apr 2019, at 17:45, Detlev Offenbach &lt;<a \
href="mailto:detlev@die-offenbachs.de" class="">detlev@die-offenbachs.de</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><div class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">Hello Grzegorz,</span><br \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">the VERSION file was meant to be created by a build script. \
Meanwhile I<span class="Apple-converted-space">&nbsp;</span></span><br \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none; float: none; display: inline !important;" class="">implemented \
something different. The idea with the 'build_py' is interesting.<span \
class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">There are some other files that \
need processing and potentially reverting this<span \
class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">change. Is there another command, \
that is called at the end of the build?<span \
class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">Maybe there is some documentation \
that explains, which commands are called in<span \
class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">which order. I intend to call it \
like</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>Just \
add the VERSION file in the MANIFEST.in file and it will then be in the source \
.tar.gz.</div><div>I also use a file to hold the version, version.txt.</div><div><br \
class=""></div><div>I use the following to build the xml-prefernences \
wheels.</div><div><br \
class=""></div><div><div>----</div><div>#!/bin/bash</div><div>rm -rf \
&nbsp;build</div><div>rm -rf &nbsp;dist</div><div>rm -rf \
&nbsp;xml-preferences.egg-info</div><div><br class=""></div><div>python3 setup.py \
sdist bdist_wheel "$@"</div><div><br class=""></div><div>ls -1 dist/*.whl</div><div \
class="">-----</div><div class=""><br class=""></div></div><br class=""><blockquote \
type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">python3 setup.py \
bdist_wheel</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">Another observation I made is, \
that "pip install eric6.whl" does not execute<span \
class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">the 'install_data' or a 'install' \
command. Any suggestion for that?</span><br style="caret-color: rgb(0, 0, 0); \
font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""></div></blockquote><div><br class=""></div><div>You can always do any one \
time setup the first time your code runs.</div><div><br \
class=""></div><div>Barry</div><div><br class=""></div><div><br \
class=""></div><blockquote type="cite" class=""><div class=""><br style="caret-color: \
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; \
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: \
start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: \
0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
float: none; display: inline !important;" class="">Detlev</span><br \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">Am Montag, 15. April 2019, 22:43:24 CEST schrieb Grzegorz \
Bokota:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><blockquote type="cite" style="font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; \
text-indent: 0px; text-transform: none; white-space: normal; widows: auto; \
word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class="">there is no VERSION file in the repository.<br \
class="">I also suggestto store __version__ varable in __init__.py of eric. The<br \
class="">allows to check it form imported lib.<br class="">Some code like:<br \
class=""><br class="">def read(*parts):<br class="">&nbsp;&nbsp;&nbsp;with \
codecs.open(os.path.join(current_dir, *parts), 'r') as fp:<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return fp.read()<br class=""><br \
class=""><br class="">def find_version(*file_paths):<br \
class="">&nbsp;&nbsp;&nbsp;version_file = read(*file_paths)<br \
class="">&nbsp;&nbsp;&nbsp;version_match = re.search(r"^__version__ = \
['\"]([^'\"]*)['\"]",<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;version_file, \
re.M)<br class="">&nbsp;&nbsp;&nbsp;if version_match:<br \
class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return version_match.group(1)<br \
class="">&nbsp;&nbsp;&nbsp;raise RuntimeError("Unable to find version string.")<br \
class=""><br class=""><br class="">You put in one file<br class=""><br \
class="">python_requires="&gt;=3.5",<br class=""><br class="">and<br class=""><br \
class="">"Programming Language :: Python :: 2.7",<br class=""><br class="">I add few \
fixes to setup.py to build ui files during build phase (lines<br class="">96-118). \
Now, on my computer, it builds (When add VERSION file) and can be<br \
class="">installed with pip install ./eric6.<br class=""><br class="">I do not use \
eric earler so i do not know how to test it.<br class="">I got warnings like \
&nbsp;Warning: translation file 'qscintilla_pl_PL'could not<br class="">be loaded. on \
startup.<br class=""><br class="">pon., 15 kwi 2019 o 18:43 Detlev Offenbach &lt;<a \
href="mailto:detlev@die-offenbachs.de" class="">detlev@die-offenbachs.de</a>&gt;<br \
class=""><br class="">napisał(a):<br class=""><blockquote type="cite" \
class="">Thanks Barry. Every example is useful.<br class=""><br class="">Detlev<br \
class=""><br class="">Am Sonntag, 14. April 2019, 22:52:46 CEST schrieb Barry:<br \
class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On 14 Apr \
2019, at 18:36, Detlev Offenbach &lt;<a href="mailto:detlev@die-offenbachs.de" \
class="">detlev@die-offenbachs.de</a>&gt;<br class="">wrote:<br class=""><br \
class="">Hello all,<br class=""><br class="">I would like to support distribution of \
eric6 via PyPI. This requires<br class=""></blockquote></blockquote><br \


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic