Changes

Jump to: navigation, search

GEPS 031: Python 3 support

1,556 bytes added, 18:29, 4 November 2020
m
minor annotation to make this page useful for stripping unnecessary detail from the Download page
{{GEPS-Finished}}{{man menu|Python 3 support added for the release of Gramps was written with python 4.0<br>Python 2. Slowly support dropped for the default python is becoming python 3. release of Gramps 4.0 will require python 2}} The Python.7+org team chose a [https://www. Ideally we also support python 3. Then in 2014org/doc/sunset-15 we can drop python -2.7 support. For convenience, we aim / sunset date for python 3Python 2 of 1 Jan 2020].2+
Gramps was written with python 2. Slowly the default python is becoming python 3. Gramps 4.0 will require python 2.7+.
 
Ideally we also support python 3. '''Then in 2014-15 we can drop python 2.7 support.''' For convenience, we aim for python 3.2+
== Guideline ==
No python 2.7 only constructs should be present, and no python 3.2 only constructs should be present.
 
== Can I work with both pythons?==
On the same family tree, normally not! For python3, bsddb is no longer a core package. You need to install python3-bsddb, and that will normally be a more recent version than what is present in python 2.7.
 
So, once you open a family tree with python3, you will not be allowed to open it with python 2.7. The only way to open it with python 2.7 is using the bsddb3 option of Gramps, and installing from source the bsddb3 package for python 2.7 that is as current as the one given in python3
 
== Tips ==
# If you work with python3, edit the ~/.subversion/config files, and add the section
global-ignores = __pycache__
# Give a family tree a name that contains 32 if you use python 3, and 27 if you use python 2. Once you open a python 2 family tree, the database is upgrade and you canot open it again in python 2 (you could export to xml and import in python 2 though)
== How? ==
* to test on python version, use ''if sys.version_info[0] < 3:'' for consistency with the other patches.
== Requirements ==
=== Ubuntu 12.10 ===
Python 3.2.3 ships with Ubuntu 12.10. To run Gramps, you will also need the packages:
# python3-gi: gobject introspection
# python3-gi-cairo: cairo gobject instrospection
# python3-cairo : This is needed to have ''import cairo'' work
# python3-bsddb3: This is needed to have ''import bsddb3'' work
== Related Gramps Bugs ==
* #{{bug|2620}}: GEPS 031: Python 3 support - 3.2
See also [[GEPS_032:_Python_3_support/Python_3_Deprecated|Python 3 Deprecated]]
[[Category:GEPS|P]]
4,602
edits

Navigation menu