46 captures
25 Jun 2018 - 16 Nov 2023
Sep OCT Nov
28
2019 2020 2021
success
fail

About this capture

COLLECTED BY

Collection: Common Crawl

Web crawl data from Common Crawl.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20201028193346/https://devguide.python.org/porting/
 

Navigation



index

next |

previous |


Python »
  Python Developer's Guide »  
|  







13. Porting Python to a new platform


The first step is to familiarize yourself with the development toolchain on the platform in question, notably the C compiler. Make sure you can compile and run a hello-world program using the target compiler.

Next, learn how to compile and run the Python interpreter on a platform to which it has already been ported; preferably Unix, but Windows will do, too. The build process for Python, in particular the Makefile in the source distribution, will give you a hint on which files to compile for Python. Not all source files are relevant: some are platform specific, others are only used in emergencies (e.g. getopt.c).

It is not recommended to start porting Python without at least medium-level understanding of your target platform; i.e. how it is generally used, how to write platform specific apps, etc. Also, some Python knowledge is required, or you will be unable to verify that your port is working correctly.

You will need a pyconfig.h file tailored for your platform. You can start with pyconfig.h.in, read the comments, and turn on definitions that apply to your platform. Also, you will need a config.c file, which lists the built-in modules you support. Again, starting with Modules/config.c.in is recommended.

Finally, you will run into some things that are not supported on your target platform. Forget about the posix module in the beginning. You can simply comment it out of the config.c file.

Keep working on it until you get a >>> prompt. You may have to disable the importing of site.py by passing the -S option. When you have a prompt, bang on it until it executes very simple Python statements.

At some point you will want to use the osmodule; this is the time to start thinking about what to do with the posix module. It is okay to simply comment out functions in the posix module that cause problems; the remaining ones will be quite useful.

Before you are done, it is highly recommended to run the Python regression test suite, as described in Running & Writing Tests.

 




Sections



1. Getting Started

2. Where to Get Help

3. Lifecycle of a Pull Request

4. Running & Writing Tests

5. Increase Test Coverage

6. Helping with Documentation

7. Documenting Python

8. Silence Warnings From the Test Suite

9. Fixing easy Issues (and Beyond)

10. Issue Tracking

11. Triaging an Issue

12. Following Pythons Development

13. Porting Python to a new platform

14. How to Become a Core Developer

15. Developer Log

16. Accepting Pull Requests

17. Development Cycle

18. Continuous Integration

19. Adding to the Stdlib

20. Changing the Python Language

21. Experts Index

22. gdb Support

23. Exploring CPythons Internals

24. Changing CPythons Grammar

25. Design of CPythons Compiler

26. Design of CPythons Garbage Collector

27. Updating standard library extension modules

28. Coverity Scan

29. Dynamic Analysis with Clang

30. Running a buildbot worker

31. Core Developer Motivations and Affiliations

32. Git Bootcamp and Cheat Sheet

33. Appendix: Topics

Previous topic


12. Following Pythons Development

Next topic


14. How to Become a Core Developer

This Page



Show Source  







Navigation



index

next |

previous |


Python »
  Python Developer's Guide »  
|  



© Copyright 2011-2020, Python Software Foundation.  
The Python Software Foundation is a non-profit corporation. Please donate.
 
Last updated on Oct 26, 2020.  Found a bug?
 Created using Sphinx 1.8.5.