Re: Problem installing scons via pip

Eric Fahlgren <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAP2Qz+W-qRyKYX4S6_kH=s=hSL3V-tUusRDeHxcM+yNM_uL+9A@mail.gmail.com>
Thanks, Bill, I did a mini-build based on that wiki page and got this down
to two small changes:

In SConstruct at line 744 add
*        commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wheel")*

*        whl = os.path.join(build,*
*                           'dist',*
*                           "%s-py2.py3-none-any.whl" % pkg_version)  #
There must be a better way?*
*        distutils_targets.append(whl)*

In src/setup.py at 509:
#distutils.core.setup(**arguments)
*import setuptools*
*setuptools.setup(**arguments)*

Here's that mini-build that produces the wheel, which I installed and used
to build our product code.

> cd scons
> rm -fr build/

> t:/Python36/python bin/update-release-info.py release
Updating src\CHANGES.txt...
Updating src\Announce.txt...
Updating SConstruct...
Updating README.rst...
Updating testing\framework\TestSCons.py...
Updating doc\user\main.xml...

> t:/Python36/python bootstrap.py > & ! build.log

> ll build/scons/dist/
total 3932
drwxr-x---+ 1 efahlgren Domain Users       0 2018-09-21 18:14 ./
drwxr-x---+ 1 efahlgren Domain Users       0 2018-09-21 18:14 ../
-rwxr-x---+ 1 efahlgren Domain Users  443123 2018-09-21 18:14
scons-3.1.0a20180921.tar.gz*
-rwxr-x---+ 1 efahlgren Domain Users  927976 2018-09-21 18:14
scons-3.1.0a20180921.win-amd64.tar.gz*
-rwxr-x---+ 1 efahlgren Domain Users 1284801 2018-09-21 18:14
scons-3.1.0a20180921.win-amd64.zip*
-rwxr-x---+ 1 efahlgren Domain Users  671140 2018-09-21 18:14
scons-3.1.0a20180921.zip*
-rwxr-x---+ 1 efahlgren Domain Users  683514 2018-09-21 18:14
scons-3.1.0a20180921-py2.py3-none-any.whl*

> pip install build/scons/dist/scons-3.1.0a20180921-py2.py3-none-any.whl
Processing
o:\scons\build\scons\dist\scons-3.1.0a20180921-py2.py3-none-any.whl
Installing collected packages: scons
Successfully installed scons-3.1.0a20180921

---
I get a bunch of warnings in the build.log, I think the more modern
setuptools is normalizing the names per PEP 508.

T:\Python36\lib\site-packages\setuptools\dist.py:398: UserWarning:
Normalizing '3.1.0.alpha.20180921' to '3.1.0a20180921'
  normalized_version,

Then the "Install" commands (copying build/scons/dist/* to build/dist)
fail, since the generated PyPi-compatible file names don't match those
known to SCons...

Install file: "build\scons\dist\scons-3.1.0.alpha.20180921.tar.gz" as
"build\dist\scons-3.1.0.alpha.20180921.tar.gz"
scons: *** [build\dist\scons-3.1.0.alpha.20180921.tar.gz]
build\scons\dist\scons-3.1.0.alpha.20180921.tar.gz: No such file or
directory
scons: building terminated because of errors.


On Fri, Sep 21, 2018 at 2:50 PM Bill Deegan <[email protected]>
wrote:

> Take a look at
> https://github.com/SCons/scons/wiki/SimplifiedReleaseProcedure
>
> In that process bootstrap.py eventually copies the files for packaging
> into build/scons where it runs setup.py
> I think it copies the scons.py to scons
>
> I'd love to get setup.py using "console_scripts" to create the
> bin/scons.. etc
>
> On Fri, Sep 21, 2018 at 5:26 PM Eric Fahlgren <[email protected]>
> wrote:
>
>> It's a lot simpler than I thought it would be.  First "*pip install
>> wheel*" (already had it in my environment).  Next, change setup.py:509
>> to use setuptools instead of distutils for the setup:
>>
>> #distutils.core.setup(**arguments)
>> import setuptools
>> *setuptools*.setup(**arguments)
>>
>> You're pretty much done.  I'm on Windows 10 x64, using Windows CPython
>> 3.6.6, setuptools 40.0.0, wheel 0.31.1, and had to do a bit of hacking to
>> fix what appear to be platform-specific things, but since I don't have a
>> Linux or Mac box available, I really don't want to make any presumptions:
>>
>> 1) At setup.py:44, I manually replaced __VERSION__ with "3.0.1" so I
>> could run the setup script directly.
>> 2) In setup.py:397 I had to add ".py" extensions to the four entries in
>> the "scripts" array.  This is because setup was complaining "can't find
>> 'script/scons'", so apparently distutils knows to do this and setuptools
>> doesn't or something.
>> scripts = [
>>     'script/scons*.py*',
>>     'script/sconsign*.py*',
>>     'script/scons-time*.py*',
>>     'script/scons-configure-cache*.py*',
>> 3) Corresponding to the above, I had to turn off adding the ".py" later
>> at line 327-329; I just commented out that whole if block:
>> #           if is_win32:
>> #               scons += '.py'
>> #               scons_ver += '.py'
>>
>>
>> Built it, ran pip, ran scons, it all worked.
>>
>> > cd src
>> > python setup.py *bdist_wheel*
>> ... blah blah blah for thousands of lines ...
>> > ll dist
>> -rwx------+ 1 efahlgren Domain Users 4181330 2018-09-21 14:03
>> scons-3.0.1-py2.py3-none-any.whl*
>>
>> > pip install dist/scons-3.0.1-py2.py3-none-any.whl
>> Processing o:\scons\src\dist\scons-3.0.1-py2.py3-none-any.whl
>> Installing collected packages: scons
>> Successfully installed scons-3.0.1
>>
>> > t:/Python36/Scripts/scons.py
>> scons: Reading SConscript files ...
>> Windows 10 build...
>>
>> _______________________________________________
>> Scons-users mailing list
>> [email protected]
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.