Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pythonic requirements #1

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use asdf
layout python3
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
sdl92.tokens
install.record

.direnv/
.idea/
.fleet/

antlr-3.1.3.tar.bz2
antlr-3.1.3/

antlr3_python3_runtime_3.4/


build
opengeode/icons.py
opengeode.egg-info

test_c

tests/**/*.stg
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.7.16
1 change: 1 addition & 0 deletions .venv
60 changes: 44 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,50 @@ compile-all:
update:
git pull

dependencies:
sudo apt install -y python3 python3-pip libgl1 gnat python3-pexpect
# installing pyside6 through pip because of bugs with QML in the Debian bullseye release
python3 -m pip install --user --upgrade pyside6
# python3-antlr3 runtime is not available in any official repo, taking in from TASTE
cd /tmp ; wget -q -O - https://download.tuxfamily.org/taste/antlr3_python3_runtime_3.4.tar.bz2 | tar jxpvf - ; cd antlr3_python3_runtime_3.4 ; python3 -m pip install --user --upgrade .
sudo apt install -y python3-pygraphviz
sudo apt install -y python3-stringtemplate3
sudo apt install -y python3-singledispatch
# install ASN1SCC in ~/.local/bin
mkdir -p ~/.local/bin
cd ~/.local ; wget -q -O - https://github.com/ttsiodras/asn1scc/releases/download/4.5.0.0/asn1scc-bin-4.5.0.0.tar.bz2 | tar jxpvf - ; cd bin ; ln -s ../asn1scc/* .
echo [-] IMPORTANT: Make sure that ~/.local/bin is in your PATH

install:
PATH=~/.local/bin:"${PATH}" pyside6-rcc opengeode.qrc -o opengeode/icons.py && python3 -m pip install --user --upgrade .

check-venv:
@if [ -z "$(VIRTUAL_ENV)" ]; then \
echo "No virtual environment is active."; \
exit 127; \
fi

antlr3_python3_runtime_3.4:
wget -q -O - https://download.tuxfamily.org/taste/antlr3_python3_runtime_3.4.tar.bz2 | tar jxpvf -


requirements.txt: requirements.in system-dependencies
$(MAKE) check-venv
pip install pip-tools
pip-compile requirements.in
# as soon as we have a requirement.txt, we install everything... can we do better ?
pip-sync

opengeode/icons.py: opengeode.qrc
pyside6-rcc opengeode.qrc -o opengeode/icons.py


system-dependencies: antlr3_python3_runtime_3.4
sudo apt install graphviz graphviz-dev

#dependencies:
# sudo apt install -y python3 python3-pip libgl1 gnat python3-pexpect
# # installing pyside6 through pip because of bugs with QML in the Debian bullseye release
# python3 -m pip install --user --upgrade pyside6
# # python3-antlr3 runtime is not available in any official repo, taking in from TASTE
# cd /tmp ; wget -q -O - https://download.tuxfamily.org/taste/antlr3_python3_runtime_3.4.tar.bz2 | tar jxpvf - ; cd antlr3_python3_runtime_3.4 ; python3 -m pip install --user --upgrade .
# sudo apt install -y python3-pygraphviz
# sudo apt install -y python3-stringtemplate3
# sudo apt install -y python3-singledispatch
# # install ASN1SCC in ~/.local/bin
# mkdir -p ~/.local/bin
# cd ~/.local ; wget -q -O - https://github.com/ttsiodras/asn1scc/releases/download/4.5.0.0/asn1scc-bin-4.5.0.0.tar.bz2 | tar jxpvf - ; cd bin ; ln -s ../asn1scc/* .
# echo [-] IMPORTANT: Make sure that ~/.local/bin is in your PATH

pyinstall: requirements.txt opengeode/icons.py
@python3 -m pip install --edit .

#install:
# PATH=~/.local/bin:"${PATH}" pyside6-rcc opengeode.qrc -o opengeode/icons.py && python3 -m pip install --user --upgrade .

full-install: update
$(MAKE) dependencies
Expand Down
4 changes: 4 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip-tools
-e antlr3_python3_runtime_3.4
pyside6
pygraphviz
54 changes: 54 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile requirements.in
#
-e file:///opt/Projects/opengeode/antlr3_python3_runtime_3.4
# via -r requirements.in
build==0.9.0
# via pip-tools
click==8.1.3
# via pip-tools
importlib-metadata==5.1.0
# via
# build
# click
# pep517
packaging==22.0
# via build
pep517==0.13.0
# via build
pip-tools==6.11.0
# via -r requirements.in
pygraphviz==1.7
# via -r requirements.in
pyside6==6.4.1
# via -r requirements.in
pyside6-addons==6.4.1
# via pyside6
pyside6-essentials==6.4.1
# via
# pyside6
# pyside6-addons
shiboken6==6.4.1
# via
# pyside6
# pyside6-addons
# pyside6-essentials
tomli==2.0.1
# via
# build
# pep517
typing-extensions==4.4.0
# via importlib-metadata
wheel==0.38.4
# via pip-tools
zipp==3.11.0
# via
# importlib-metadata
# pep517

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools