Skip to content
Snippets Groups Projects
Name Last commit Last update
bin
isgphys
.gitignore
README.md
setup.py

python

This repo contains python scripts and modules which may not be available as package.

installation

Install the required packages

apt install python3 python3-dev python3-setuptools python3-pip python3-virtualenv virtualenv libacl1-dev libkrb5-dev

then clone the repo and install it inside a virtualenv

cd /opt
git clone git@gitlab.phys.ethz.ch:core/python.git
cd python
virtualenv -p python3 .venv
source .venv/bin/activate
pip install -e .
deactivate

feature request

If you would like to have a new feature, script or module, open an issue.

  • add title and description
  • choose assignee: the person who should do it or Unassigned
  • choose label: Feature request
  • submit

bug report

To report a bug, open an issue.

  • add title and description
  • choose assignee: the person who should do it or Unassigned
  • choose label: Bug
  • submit

contributing

This gitlab repo will be cloned to many locations, and the master branch should always be stable.

Therefore the master branch is protected. No one can push to it directly. If you want someone else to review your changes it might be a good workflow to make a pull request (also for documentation purpose)

branching

To contribute create your own local-<yourname> branch or a feature/bugfix branch:

git checkout -b newfeature
git push -u origin newfeature

Make your changes and push to your branch:

git add -A
git commit
git push

pull request

After the push, git will show you the link to open a pull request:

remote: To create a merge request for local-rda, visit:
remote:   https://gitlab.phys.ethz.ch/core/python/merge_requests/new?merge_request%5Bsource_branch%5D=newfeature

You can also go to branches and click Merge request.

  • add description: If it closes an issue write the issue nuber it fixes (Fixes #1 / Closes #1)
  • add assignee (optional)
  • add label: Feature or Fix
  • submit

Let someone review it and discuss. Changes shows the diff.

merge

Once it is ready to be merged:

  • merge it by clicking the green Merge button
  • remove source branch now with the Remove Source Branch button (optional)

pull in feature branch

If you want to continue working in your branch, do:

git checkout newfeature
git pull --rebase origin master

This will do a fast-forward merge.

pull in master branch

git checkout master

Pull the updated master branch (which now contains your work):

git pull

A pull actually does this:

git fetch origin
git merge origin/master

rebase branch

If you decide to make another commit in this branch, rebase first:

git checkout newfeature
git rebase origin/master

This will do a fast-forward merge.

delete feature branch

You could now also safely remove your feature branch in your own git repo:

git branch -d newfeature