如何为python3和python2开发pypi包 [英] how to develop pypi package for python3 and python2

查看:134
本文介绍了如何为python3和python2开发pypi包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能指出我的教程,该教程说明如何实现同时支持python2和python3的pypi软件包? Google没有提供答案,因此这是我的下一个选择!谢谢.

Can anyone point me toward a tutorial explaining how to implement a pypi package with support for both python2 and python3? Google did not provide an answer so this is my next option! Thank you.

推荐答案

许多关于Python包装的教程的问题是,它们尝试使用这么多可能的选项覆盖很多领域.当我处于这个阶段时,考虑到您可能遇到的变量数量以及某些部分的Python历史打包问题,它们仍然很引人入胜.我发现它们非常令人困惑.

The problem with many tutorials out there on Python packing is that they try to cover a lot of ground, with so many possible options. When I was at this stage, I found them very confusing, given the number of variables you might encounter, and the amount of Python historical packaging issues some of them still lead you through.

我的建议是采用一个您知道可以在Python 2和Python 3上很好运行并且安装到PyPI的模块,并对其进行研究.对其进行修改,用您自己所需的代码和模块配置替换零件.您可以随时将自己知道的工作与当前的工作进行比较,从而为测试和探索打下坚实的基础.

My recommended is to instead take a module that you know runs well across Python 2 and Python 3, and that installs to PyPI, and study it. Modify it, replacing parts with your own desired code and module configuration. You can always compare what you know works to what you currently have, giving you a solid base for testing and exploration.

我不遗余力地向您提供我的 intspan 模块作为这样的起点.它运行在许多Python实现中,包括2和3.它具有广泛的测试范围.其来源是随时可用以进行克隆.如果不是intspan,请以其他模块为起点,而不是抽象教程.

I unhumbly offer you my intspan module as one such starting point. It runs across a great many Python implementations, including 2 and 3. It has extensive test coverage. And its source is readily available for cloning. If not intspan, take some other module as your starting point, rather than an abstract tutorial.

这篇关于如何为python3和python2开发pypi包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆