Skip to main content

Small cli - tool to support GAMS4+ local development

Project description

bock

Very basic cli-tool to support local (GAMS4+)[http://gams.uni-graz.at/] project development.

Quick Start

# 1. make sure python3 + pip are installed
pip install bock


# 2. restart shell / wsl etc.
# run bock
bock

Requirements

  • python 3.10.0?
  • pip installed

Bock development

Windows

# cd to clone of repo
cd /to/the/clone

# install via pip locally
pip install .
# logout / login from wsl afterwards

# launch bock commands
bock [cmd]

# launch demo sub-command (inside commands/demo.py)
bock demo testme

WSL / Linux

# cd to clone of repo
cd /to/the/clone

# activate venv (needs virtualenv installed)
source venv/Scripts/activate    # if there is an error (like command not found -> use dos2Unix command on venv/Scripts/activate )

# install via pip locally
pip install .
# logout / login from wsl afterwards

# launch bock commands
bock [cmd]

# launch demo sub-command (inside commands/demo.py)
bock demo testme

Idols / Sources

1. Install pip (WSL + Ubuntu 20.x LTS)

# pip wsl ubuntu installation
# update / upgrade ubuntu first
sudo apt update && sudo apt upgrade
# install pip on ubuntu
sudo apt install python3-pip
# then install bock

Install

  1. create venv
  2. install requirements specified in requirements.txt
  3. code along!

Update bock

# update bock
py -m pip install --upgrade bock

Aims

  1. Simplify
  • setting up the dev assets shpuld be
  1. Centralize
  • avoid copying of old code. Make sure to spread best practices / bug fixes etc.
  1. Abstract away:
  • knowledge about different repositories and other implementation details.
  1. Validate:
  • integrate frontend test possiblity into the tool

Example cli calls


Production / Packaging

# on windows!
# launch venv first
# cd into clone
./venv/Scripts/activate.bat

# then increment version in setup.py according to semantic versioning!

# build python wheel
py -m build --wheel

# OPTIONAL: check if description is valid
twine check dist/*

Deployment (on pypi)

Pypi

# First build files + create pypi account (if not existing)
# username: __token__
# pw: MYTOKEN
twine upload dist/*

# install from pypi
pip install bock

Testpypi

# test on testpypi
# need to specify testpypi repo
# username: __token__
# pw: MYTOKEN
twine upload dist/* --repository testpypi

# install from testpypi
# needs to be done this way -> deps need to be installed from pypi and not the test instance.
pip install bock --extra-index-url https://test.pypi.org/simple 

Testing

Manual Deployment

Installation from TestPypi

# first update ubuntu stuff
sudo apt-get update && apt-get upgrade 

# install pip first
sudo apt-get python3-pip

# install from testpypi
# needs to be done this way -> deps need to be installed from pypi and not the test instance.
pip install bock --extra-index-url https://test.pypi.org/simple 
# (when on wsl -> restart wsl )

# use bock
bock project setup "templates"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

bock-0.2.0-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page