Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daikk115/package_python_app
https://github.com/daikk115/package_python_app
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/daikk115/package_python_app
- Owner: daikk115
- Created: 2016-10-19T11:11:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-21T09:16:55.000Z (almost 8 years ago)
- Last Synced: 2024-10-03T23:13:38.633Z (about 1 month ago)
- Language: Python
- Size: 19.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Code Climate](https://codeclimate.com/github/daikk115/package_python_app/badges/gpa.svg)](https://codeclimate.com/github/daikk115/package_python_app)
# python_app
How To Package And Distribute Python Applicationshttps://www.digitalocean.com/community/tutorials/how-to-package-and-distribute-python-applications
#### Installation
- Working directory: `~/MyApplication/FlaskApp$`
- For develop, we just need two commands like bellow:```
python setup.py develop # create .egg.link to FlaskApp
python setup.py develop -u #To reverse
```
- For normal user:```
python setup.py install
```#### Using:
- Just run bellow command in terminal:
```
flaskapp
```#### Package application to .deb file
```
apt-get install python-stdeb fakeroot python-all
python setup.py --command-packages=stdeb.command bdist_deb
```
- fakeroot: run a command in an environment faking root privileges for file manipulation
- python-steb: produces Debian source packages from Python packages
#### NOTE:- Use setuptools substitute for distutils
```
#from distutils.core import setup
from setuptools import setup
```
- Upgrade setuptools```
pip install --upgrade setuptools pip
```
- Config requirement packages: [Normally, we have two ways to say for users which dependencies packages they need for our app](https://packaging.python.org/requirements/).+ Config install_requires in setup.py : require when we setup via deb file
+ Config requirements.txt : not require when we setup, just recommend users run `pip install -r requirements.txt`In this super small example project, I just use install_requires.
- This is my env in my test case:
```
daidv@Winner:~/MyApplication/FlaskApp$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'28.6.0'
>>> import flask
>>> flask.__version__
'0.11.1'
>>>
```- To do: I must to remove load config and render from template in this branch
because I'm facing some bug like ".egg is not directory, we can read file template in it"
>> In future, I will come back to bump it.+ Remove load config: app/__init__.py
+ Return fixed value in module_one/controllers.py#### References
- [two way that we need to add a script into /usr/local/bin](https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html)
- [Use stdeb to make Debian packages for a Python package](http://shallowsky.com/blog/programming/python-debian-packages-w-stdeb.html)
- [Python to Debian source package conversion utility](https://pypi.python.org/pypi/stdeb/0.8.5)