Skip to content

Commit e548e87

Browse files
committed
Convert to pyside6, nix flake development
1 parent c641522 commit e548e87

File tree

6 files changed

+1002
-45
lines changed

6 files changed

+1002
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
.aider*

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,8 @@ it mostly doesn't.
8989

9090
![](docs/Screenshot_0.png)
9191

92+
## Development
93+
94+
I use dev containers and nixos.
95+
96+
`nix-shell -p xorg.xhost --run "xhost +local:docker"`

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
description = "Python Qt development environment with UV";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
in
14+
{
15+
devShells.default = pkgs.mkShell {
16+
buildInputs = with pkgs; [
17+
# Python and UV
18+
python311
19+
uv
20+
21+
# Qt libraries
22+
#qt6.full
23+
qt6.qtbase
24+
#qt6.qttools
25+
26+
# Python Qt bindings (available system-wide for reference)
27+
python311Packages.pyqt6
28+
python311Packages.pyside6
29+
30+
# Development tools
31+
python311Packages.pip
32+
];
33+
34+
shellHook = ''
35+
echo "Qt Python development environment with UV"
36+
echo "Python: $(python --version)"
37+
echo "UV: $(uv --version)"
38+
echo ""
39+
echo "Use 'uv init' to create a new project"
40+
echo "Use 'uv add pyqt6' or 'uv add pyside6' to add Qt bindings"
41+
echo "Use 'uv run python your_app.py' to run your application"
42+
'';
43+
44+
# Required for Qt applications
45+
QT_QPA_PLATFORM_PLUGIN_PATH = "${pkgs.qt6.qtbase}/lib/qt-6/plugins";
46+
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath [ pkgs.qt6.qtbase ]}";
47+
};
48+
}
49+
);
50+
}

pyproject.toml

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,40 @@
1-
[tool.poetry]
1+
[project]
22
name = "pysdfscad"
33
version = "0.1.0"
44
description = ""
5-
authors = ["Alex Davies <[email protected]>"]
5+
authors = [{ name = "Alex Davies", email = "[email protected]" }]
6+
requires-python = ">=3.10,<3.12"
67
readme = "README.md"
7-
8-
packages = [
9-
{ include = "pysdfscad" },
10-
{ include = "pysdfscad_qtgui" },
8+
dependencies = [
9+
"sdf",
10+
"lark>=1.1.5,<2",
11+
"loguru>=0.6.0,<0.7",
12+
"click>=8.1.3,<9",
13+
"appdirs>=1.4.4,<2",
14+
"astor>=0.8.1,<0.9",
1115
]
1216

13-
include = ["pysdfscad/openscad.lark"]
14-
15-
[tool.poetry.dependencies]
16-
#python = "^3.10"
17-
python = ">=3.10,<3.12" #Required for pyinstaller
18-
sdf = {git = "https://github.com/fogleman/sdf.git"}
19-
lark = "^1.1.5"
20-
loguru = "^0.6.0"
21-
click = "^8.1.3"
22-
appdirs = "^1.4.4"
23-
astor = "^0.8.1"
24-
mkdocs-macros-plugin = "^0.7.0"
25-
26-
[tool.poetry.extras]
27-
qtgui = ["pyqt5", "qscintilla", "pyqtgraph", "pyopengl"]
28-
#docs = ["Sphinx", "sphinx-rtd-theme",]
29-
30-
[tool.poetry.scripts]
17+
[project.scripts]
3118
pysdfscad = "pysdfscad.main:main"
32-
pysdfscad_qtgui = { callable = "pysdfscad_qtgui.main:main", extras = ["qtgui"] }
19+
pysdfscad_qtgui = "pysdfscad_qtgui.main:main"
20+
21+
[project.optional-dependencies]
22+
gui = [
23+
"pyside6>=6.9.3",
24+
"qscintilla>=2.13.3,<3",
25+
"pyqtgraph>=0.13.1,<0.14",
26+
"pyopengl>=3.1.6,<4",
27+
]
28+
dev = [
29+
"pytest>=7.2.0,<8",
30+
"black>=22.12.0,<23",
31+
]
3332

34-
[tool.poetry.group.dev.dependencies]
35-
pytest = "^7.2.0"
36-
black = "^22.12.0"
37-
coverage = "^7.0.5"
38-
nuitka = "^1.4.5"
39-
ordered-set = "^4.1.0"
40-
zstandard = "^0.19.0"
41-
pyinstaller = "^5.8.0"
42-
pyinstaller-hooks-contrib = "^2022.15"
43-
mkdocs = "^1.4.2"
44-
mkdocstrings = {extras = ["python"], version = "^0.20.0"}
45-
mkdocs-material = "^9.0.12"
33+
[tool.uv]
34+
package = true
4635

47-
[tool.poetry.group.qtgui.dependencies]
48-
pyqt5 = "^5.15.7"
49-
qscintilla = "^2.13.3"
50-
pyqtgraph = "^0.13.1"
51-
pyopengl = "^3.1.6"
36+
[tool.uv.sources]
37+
sdf = { git = "https://github.com/fogleman/sdf.git" }
5238

53-
[build-system]
54-
requires = ["poetry-core"]
55-
build-backend = "poetry.core.masonry.api"
39+
[tool.setuptools]
40+
packages = ["pysdfscad", "pysdfscad_qtgui"]

0 commit comments

Comments
 (0)