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
- https://github.com/IVIURRAY/yt-eve
- https://www.youtube.com/watch?v=Jr4QDJwwj60&ab_channel=SoftwareEngineerHaydn
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
- create venv
- install requirements specified in requirements.txt
- code along!
Update bock
# update bock
py -m pip install --upgrade bock
Aims
- Simplify
- setting up the dev assets shpuld be
- Centralize
- avoid copying of old code. Make sure to spread best practices / bug fixes etc.
- Abstract away:
- knowledge about different repositories and other implementation details.
- Validate:
- integrate frontend test possiblity into the tool
Example cli calls
Production / Packaging
-
according to official doc here: https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project
-
based on windows machines
-
packaged as "wheel" (check doc link from before)
# 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)
-
check docu for api token (test out on testpypi)
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
Release history Release notifications | RSS feed
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)