Skip to content

Project Management docs

Claudio Sparpaglione edited this page May 10, 2020 · 25 revisions

Table of Contents

Distribution channels

AUR (ArchLinux)

GitHub Wiki management

The Wiki is handled as a Git submodule of the project.

The submodule is "mounted" under the '/wiki' folder.

These are the instructions to setup the submodule:

$ cd <PYOWM-root>
$ git submodule add https://github.com/csparpa/pyowm.wiki.git wiki
$ git submodule init

Clone the wiki as a submodule by running: git submodule update --init

Installing multiple Python versions

On Ubuntu:

$ sudo apt-add-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.2 python 3.3

Goodreads

Releasing

Checklist

  1. CODE
  • update version on constants.py
  • update setup.py and Pipfile
  • update city ID files with: cd scripts & python generate_city_id_files.py ../pyowm/weatherapi25/cityids - then check outputs --> and don't forget to gzip them!
  • update README.md
  • update technical docs in docs folder
  • run unit tests with: tox
  • run integration tests
  • generate documentation locally with: cd scripts & bash generate_sphinx_docx.sh - then fix any warnings/errors
  • push dump commit
  1. GITHUB
  • new pull request: merge develop branch into master branch
  • close milestone on GitHub
  • update GitHub Wiki pages
  • update CHANGELOG
  • update DEPRECATIONS
  • tag release on GitHub
  1. DISTRIBUTION
  • generate new Docker image with: cd scripts & bash generate_docker_image.sh <x.y.z>
  • push Docker image to DockerHub with: cd scripts & bash publish_to_dockerhub.sh <x.y.z>
  • generate pypi distributions with: cd scripts & bash generate_pypi_dist.sh
  • upload release on pypi: cd scripts & bash publish_to_pypi.sh
  • test locally that installation via pip works: bash tests/installation_test.sh
  1. RELATED PROJECTS
  • check for domain entities changes and update Django models on django-pyowm

Detailed steps

Update Pipfile.lock

Use a virtualenv:

$ cd && virtualenv pipfilelocker
$ source pipfilelocker/bin/activate
$ pip install pipenv
$ cd <path-to-pyowm-folder>
$ pipenv lock
$ deactivate                   # deactivate venv
$ cd && rm -rf pipfilelocker   # remove venv

Build documentation

First install Sphinx:

$> easy_install sphinx

Then setup the docs folder: move to the main project folder and launch

$> mkdir sphinx
$> sphinx-apidoc -A "<authorname>" -F -o sphinx pyowm/

Sphinx will create its configuration stuff under the sphinx/ subfolder Modify the sphinx/conf.py file by adding/uncommenting this line:

sys.path.insert(0, os.path.abspath('..'))

Now you are ready to generate HTML docs by launching:

$> cd sphinx/
$> make html

HTML docs will be generated under sphinx/_build/html

Updating City ID Files

cd scripts
python generate_city_id_files.py

Uploading to PyPi using Twine

python2.7 setup.py sdist --format=zip  # source dist
python2.7 setup.py bdist_egg  # py27 egg
python3.2 setup.py bdist_egg  # py32 egg
python3.3 setup.py bdist_egg  # py33 egg
python3.4 setup.py bdist_egg  # py34 egg
python3.5 setup.py bdist_egg  # py35 egg
python3.6 setup.py bdist_egg  # py36 egg
twine upload dist/*           # upload to pypi

Upload manually to PyPi

The following commands are to be issued using a specific Python interpreter (eg: if you launch them using Python 3.3 it will result in 3.3-compatible artifacts (.zip with sources, .egg and win installer) being uploaded to the Cheesehop. Enter the main project directory and issue:

$> <path-to-python-interpreter> setup.py sdist register upload  # Raw source dist
$> <path-to-python-interpreter> setup.py bdist_egg upload       # Eggball
$> <path-to-python-interpreter> setup.py bdist_wininst upload   # Windows .exe installer

If you don't want artifacts to be uploaded but just be created locally, omit the upload switch.

Some references: