简体   繁体   English

升级金字塔,SQLAlchemy,zope并重建Python项目

[英]Upgrade pyramid, SQLAlchemy, zope and rebuild Python project

I have inherited a Python REST API that runs on Ubuntu. 我继承了在Ubuntu上运行的Python REST API。

My main goal is to update these Python components to the latest releases, eg zope is now at 2.0. 我的主要目标是将这些Python组件更新到最新版本,例如zope现在是2.0。

It uses Python 2.7, Pyramid 1.4.1, zope 0.6, transaction 1.3, SQLAlchemy 0.7.9, WebError 0.10.3, and uses nginx as the web server. 它使用Python 2.7,Pyramid 1.4.1,zope 0.6,事务1.3,SQLAlchemy 0.7.9,WebError 0.10.3,并将nginx用作Web服务器。 Oh, and it uses cx_Oracle to connect to the Oracle instance. 哦,它使用cx_Oracle连接到Oracle实例。

The project (and other items) are in a folder called rest_api, where I can see setup.py, and some other custom setups, setup_prod.py, etc. 该项目(和其他项目)位于一个名为rest_api的文件夹中,在该文件夹中可以看到setup.py,以及一些其他自定义设置,setup_prod.py等。

I went to /usr/local/lib/python-2.7/sites-packages and I tried running "pip install --upgrade [package_name]" and the command completes successfully for each package. 我去了/usr/local/lib/python-2.7/sites-packages,尝试运行“ pip install --upgrade [package_name]”,并且每个软件包的命令成功完成。

Is this all I need to do, or do I have to rebuild the project with setup*.py? 这是我所需要做的吗,还是必须使用setup * .py重建项目?

I found some notes that showed 2 commands that look like what I want - 我发现了一些注释,其中显示了2条看起来像我想要的命令-

rebuild_cmd = "cd %s/python/rest_api/; /usr/bin/env python setup_prod.py build" % current_dir
install_cmd = "cd %s/python/rest_api/; sudo /usr/bin/env python setup_prod.py install" % current_dir

...but when I try running "python setup_prod.py build" from the directory, with or without sudo, I get a traceback error. ...但是当我尝试从目录运行“ python setup_prod.py build”时,无论是否使用sudo,都会出现回溯错误。

To summarize - 总结一下-

  1. How do I upgrade the python packages like zope, SQLAlchemy, Pyramids, etc. to the latest release? 如何将zope,SQLAlchemy,Pyramids等python软件包升级到最新版本?

  2. Do I need to rebuild the project if I am only upgrading the python packages from above? 如果仅从上面升级python包,是否需要重建项目?

  3. Without knowing the program details, is there a "basic" python build sequence that I can try, eg run setup.py build, then setup.py install, or something else? 在不知道程序详细信息的情况下,是否可以尝试“基本”的python构建顺序,例如运行setup.py构建,然后setup.py安装或其他操作?

It uses Python 2.7, Pyramid 1.4.1, zope 0.6, transaction 1.3, SQLAlchemy 0.7.9, WebError 0.10.3 它使用Python 2.7,Pyramid 1.4.1,zope 0.6,事务1.3,SQLAlchemy 0.7.9,WebError 0.10.3

How do you know this? 你怎么会知道这事? Find the place where any of these versions are mentioned (I guess they should be mentioned somewhere in setup_prod.py ), change them to what you want, build the project and check if the app works with new dependencies. 找到提到任何这些版本的地方(我想应该在setup_prod.py中的某些地方提到它们),将它们更改为所需的形式,构建项目并检查应用程序是否具有新的依赖项。

...but when I try running "python setup_prod.py build" from the directory, with or without sudo, I get a traceback error. ...但是当我尝试从目录运行“ python setup_prod.py build”时,无论是否使用sudo,都会出现回溯错误。

Please show your traceback. 请显示您的追溯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM