Skip to content

Commit

Permalink
Configure Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbayley committed May 2, 2024
1 parent efd676c commit 15a6a73
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,32 @@
"name": "Gazelle",
"runArgs": ["--name", "gazelle"],
"build": { "dockerfile": "Dockerfile" },
"postCreateCommand": "poetry install",
"privileged": true,
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/powershell": {},
"ghcr.io/devcontainers/features/rust:1": {}
"ghcr.io/devcontainers/features/rust:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"toolsToInstall": "pipx, poetry",
"installTools": true,
"optimize": false,
"enableShared": false
}
},
"customizations": {
"vscode": {
"extensions": [
"bierner.markdown-preview-github-styles",
"charliermarsh.ruff",
"github.copilot",
"github.vscode-github-actions",
"grapecity.gc-excelviewer",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.powershell",
"redhat.vscode-xml",
"rust-lang.rust-analyzer",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"recommendations": [
"bierner.markdown-preview-github-styles",
"charliermarsh.ruff",
"github.copilot",
"github.vscode-github-actions",
"grapecity.gc-excelviewer",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.powershell",
"redhat.vscode-xml",
"rust-lang.rust-analyzer",
Expand Down
19 changes: 18 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"files.exclude": {
"**/.git": false,
"**/bin": false,
"**/obj": true
"**/obj": true,
"poetry.lock": true,
".pytest_cache": true
},

"git.autofetch": true,
Expand All @@ -32,6 +34,21 @@
"powershell.integratedConsole.showOnStartup": false,
"powershell.suppressAdditionalExeNotFoundWarning": false,

"python.analysis.autoFormatStrings": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"python.languageServer": "Pylance",
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "pytest",

"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always",
"source.fixAll": "explicit"
}
},

"terminal.integrated.fontFamily": "'FiraCode Nerd Font Mono', 'Fira Code', Menlo, Monaco, Consolas",

"workbench.editor.highlightModifiedTabs": true,
Expand Down
Empty file added bindings/python/__init__.py
Empty file.
1 change: 1 addition & 0 deletions bindings/python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Welcome to Gazelle! 🦌')
2 changes: 2 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tool.poetry]
name = "gazelle"
version = "0.1.0"
readme = "README.md"
description = "A fast engine for civil engineering design."
repository = "https://github.com/gazellekit/gazelle.git"
authors = ["James S. Bayley <https://www.linkedin.com/in/jsbayley>"]
license = "AGPL-3.0-or-later"
packages = [{ include = "bindings/python" }]

[tool.poetry.dependencies]
python = ">=3.11"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.1"
ruff = "^0.2.2"

[tool.ruff]
indent-width = 2

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 15a6a73

Please sign in to comment.