-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #86 from borrob/pr_python3 - THE SWITCH Py2 to Py3
Squash all commits for the python 3 development. This is the definitive switch from Python 2 to 3, no way back!
- Loading branch information
Showing
140 changed files
with
2,953 additions
and
1,623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ Contents: | |
|
||
intro.rst | ||
install.rst | ||
py3upgrade.rst | ||
background.rst | ||
using.rst | ||
cases.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. _py3upgrade: | ||
|
||
Upgrade to Python 3 | ||
=================== | ||
|
||
Stetl development started in Python 2. With `PEP 373 | ||
<https://legacy.python.org/dev/peps/pep-0373/>`_ the EOL of python 2.7 was announced and python 2 | ||
will not be officialy supported after 2020. Stetl was therefore upgraded to Python 3. | ||
|
||
Python 3 | ||
-------- | ||
|
||
Work started early 2019 to upgrade ``Stetl`` from Python 2 to Python 3. The last version of Stetl | ||
that supports Python 2 is version 1.3. This version *might* receive quick fixes and updates, but | ||
users are encouraged to upgrade to Stetl version 2 or higher and thus use Python 3. | ||
|
||
For the full discussion on the Python 2 to Python 3 migration: see the `conversation in pull | ||
request #81 <https://github.com/geopython/stetl/pull/81>`_ within the GitHub repository. | ||
|
||
Important changes for developers | ||
-------------------------------- | ||
|
||
Python 2 and 3 are very similar, but there are a couple of important changes that developers need | ||
to keep in mind and are worth mentioning: | ||
|
||
- Stetl 2 supports Python 3.4.2 and higher (so unfortunately no `f strings <https://www.python.org/dev/peps/pep-0498/>`_) | ||
- Python 3 uses Unicode strings, meaning encoding/decoding is a bit different | ||
- ``stringIO`` and ``cstringIO`` were moved around | ||
- slight syntax change on calling ``next()`` for iterators | ||
- update on ``import`` statements | ||
- differences in ``urllib`` to make http-calls (although `issue 80 <https://github.com/geopython/stetl/issues/80>`_ might change it to the `requests` library). | ||
|
||
Important changes for users | ||
--------------------------- | ||
|
||
The specification of the Stetl tool chain uses a configuration file. You can use the Inputs, Filters, and | ||
Outputs that are provided by Stetl, or write your own. If you use Stetl Components in your configuration, you *must* | ||
specify the ``stetl.`` package prefix in the class specification. For example before Stetl version 2 the input XML | ||
file was specified as :: | ||
|
||
[input_xml_file] | ||
class = inputs.fileinput.XmlFileInput | ||
file_path = input/cities.xml | ||
|
||
for Stetl version 2 this is changed to :: | ||
|
||
[input_xml_file] | ||
class = stetl.inputs.fileinput.XmlFileInput | ||
file_path = input/cities.xml | ||
|
||
Note the extra ``stetl.`` part in the ``class`` specification. |
Oops, something went wrong.