Setup to run projects on Ubuntu

Setup for Ubuntu

These instructions were confirmed by creating an empty Ubuntu 22.04 image in VirtualBox VM, see Creating Vbox VM.

  • Open Terminal, add to favorites if necessary

  • install git and ssh

sudo apt install openssh-client
sudo apt install git
  • set up bitbucket and clone a project
# do once: set up ssh key
# see https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-linux/
ssh-keygen -t ed25519 -b 4096 -C "username@emaildomain.com" -f ~/.ssh/bitbucket
cat ~/.ssh/bitbucket.pub
  • save to your bitbucket account
    • Open Bitbucket https://bitbucket.org
    • go to settings (the cog icon)
    • select "Person Bitbucket settings"
    • select "SSH keys"
    • click "Add key"
    • dlgbox "Add SSH key"
      • enter a Label to remember which machine this is for
      • paste the content of bitbucket.pub into "Key"
    • click "Add key"

Run a project the first time

Assume the project will be created in the ~/projects directory.

See Dev Python Application Template page for a description.

  • clone the project
cd ~/projects

git clone git@bitbucket.org:arrizza-public/devpy-app-template.git
cd devpy-app-template
  • do an initial setup of the submodule(s)
# setup submodules
./do_subm_update full

# check it's created
ll tools
#<snip>
drwxrwxr-x 5 arrizza arrizza   4096 Feb 27 09:45 xplat_utils/
  • do a full install
# do a full install to get additional packages needed
# and to set up python venv
./do_install full
# takes a 5-10m minutes the first time
  • check that it worked okay
./do_check

Initially there will be 3 error/warnings:

  • WARN Doxyfile: Doxyfile not found, skipping check

    • this will be fixed by ./do_doc in the next step
  • ERR .gitconfig cannot find /home/arrizza/.gitconfig

    • create a ~/.gitconfig for your own preferences and install it ~/.gitconfig
    • I use meld (sudo apt install meld) for diff and merge see Set up gitconfig
  • ERR .pypirc exists : False

[pypi]
username= __token__
password= <your token password>
  • generate doc, check lint and other commands
./do_doc
# there should an out directory and a doc/devpy-app-template.pdf.
# open it and check the contents of the PDF

./do_check
# the warning above for doxygen should be gone

./do_lint
# should be no warnings

./do_update
# note: setuptools may be "out of date", it's not used in this project
  • check it runs
./doit
# rc should be 0
# this prints logger examples so there will be "WARN" and "ERR" lines

./do_ver
# rc should be 0
# check coverage by opening out/coverage/index.html, should 85% or higher

./do_ut
# rc should be 0
# check coverage by opening out/coverage/index.html, should 5% or higher     

run a project - subsequent

Once the project is cloned and run once, some of the steps above can be simplified

cd ~/projects/devpy-app-template

# double-check submodules are up to date
./do_subm_update

# do a quick update (if any) of linux and pip packages
./do_install

# get doc
./do_doc
./do_check

# check it
./do_lint
./do_update

# run it
./doit
./do_ver
./do_ut

- John Arrizza