|
|
## Packaging your code
|
|
|
|
|
|
The first step of an integration process is being able to install the project with
|
|
|
its dependencies. In Python it is done using a *setup.py* script written with
|
|
|
*setuptools*.
|
|
|
The script simply calls *setuptools.setup* function with the package description
|
|
|
: package directory, name, description, author, license, version, dependencies,
|
|
|
supported Python versions, . . .
|
|
|
The first step of an integration process is being able to install the project
|
|
|
with its dependencies. In Python it is done using a *setup.py* script written
|
|
|
with *setuptools*.
|
|
|
The script simply calls *setuptools.setup* function with the package
|
|
|
description: package directory, name, description, author, license, version,
|
|
|
dependencies, supported Python versions, . . .
|
|
|
|
|
|
### Usage
|
|
|
This *setup.py* script is the entry point for installing and releasing your code.
|
... | ... | @@ -16,6 +16,8 @@ python setup.py <command> [opts] |
|
|
python setup.py install
|
|
|
# Install the package in a way that lets you edit the sources
|
|
|
python setup.py develop
|
|
|
# Build the package in a *build* directory
|
|
|
python setup.py build
|
|
|
# Upload your last revision to *PyPi* repository
|
|
|
python setup.py upload
|
|
|
```
|
... | ... | @@ -54,7 +56,8 @@ setup( |
|
|
)
|
|
|
```
|
|
|
|
|
|
Depending on your needs, you can specify the version with ==, <, != operators.
|
|
|
Depending on your needs, you can specify the version with `==`, `<`, `!=`, ...
|
|
|
operators.
|
|
|
|
|
|
#### Note
|
|
|
|
... | ... | @@ -85,8 +88,8 @@ Versioning should help users follow features addition and know when |
|
|
incompatible changes have been introduced. Semantic Versioning gives you simple
|
|
|
rules for changing your version numbers.
|
|
|
|
|
|
From [http://semver.org/](http://semver.org/) summary : Given a version number MAJOR.MINOR.PATCH,
|
|
|
increment the :
|
|
|
From [http://semver.org/](http://semver.org/) summary : Given a version number
|
|
|
MAJOR.MINOR.PATCH, increment the :
|
|
|
1. MAJOR version when you make incompatible API changes,
|
|
|
2. MINOR version when you add functionality in a backwards-compatible
|
|
|
manner, and
|
... | ... | |