daveoncode
daveoncode

Reputation: 19578

Pyramid config .ini files, setup.py and requirements.txt

I just started learning Pyramid using the official documentation and I found it very cool so far. Unfortunately, while the basic one-file app is really simple and straight, I'm having an hard time trying to understand how a "serious app", generated using the pcreate scaffolding command (alchemy in my case), is supposed to be handled. For example:

Upvotes: 4

Views: 1047

Answers (2)

Steve Piercy
Steve Piercy

Reputation: 15045

There are several tutorials that addresses all these topics, and provide references to further relevant reading for each step along the way. I suggest starting with the Quick Tutorial.

To answer your bullet points in order:

  • setup.py is a standard for installing Python packages and dependencies and testing your app.
  • If you need to install more packages as a result of your changes, then yes. EDIT: It is now recommended to use pip install -e . for installing more packages. Also while developing, you can use pserve development.ini --reload which will monitor file changes and restart the server for you.
  • For more information about the meaning of the use = egg:MyProject, see Entry Points and PasteDeploy .ini Files. There are many ways to configure Pyramid apps including Application Configuration and Advanced Configuration.

Upvotes: 2

Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83808

You chose Pyramid, the best Python web microframework, a very choice! Here are some pointers for further insight. Actually your question is not specific to Pyramid, but generally how Python packages and applications generally work.

is setup.py mandatory or can I just use requirements.txt as I'm used to do with Django in order to install dependencies?

It is not. You can use requirement.txt. setup.py install_dependencies is mainly for libraries. For more information read blog post Declaring dependencies in Python.

if I have to rely on setup.py am I supposed to execute python setup.py develop each time I create/delete a new file (since I saw them listed in SOURCES.txt)?

It's not necessary.

In settings.ini how "use" (under [app:main]) works? (can I "bypass" the egg-info which is it pointing to and "bootrsapping" the app in an alternative way?)

Please see the other answer regarding Paster and Entry points.

Upvotes: 1

Related Questions