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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file bock-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bock-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for bock-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 711321118c0de972135b54b45559ddd489b99b4bf2faaca9a3b3af1d85d3eedc
MD5 ba2a094fd4d46e32d2a20ea088963858
BLAKE2b-256 c6afb8dd50e96a718648e2a963faddf7fd7b5cad1c5119683dc05de034b46d5d

See more details on using hashes here.

Supported by

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