Skip to content

Commit

Permalink
Update project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbayley committed May 3, 2024
1 parent 5c19a1e commit c51199d
Show file tree
Hide file tree
Showing 28 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Gazelle",
"runArgs": ["--name", "gazelle"],
"build": { "dockerfile": "Dockerfile" },
"postCreateCommand": "cd gazelle && poetry install",
"postCreateCommand": "poetry install && cargo build",
"privileged": true,
"features": {
"ghcr.io/devcontainers/features/git:1": {},
Expand Down
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"files.exclude": {
"**/.git": false,
"**/bin": false,
"**/obj": true,
"**/target/": false,
"**/target/": true,
"**/poetry.lock": true,
"**/__pycache__": true,
"**/.pytest_cache": true,
"**/.venv": false
"**/.venv": true
},

"git.autofetch": true,
Expand All @@ -38,7 +37,7 @@
"powershell.suppressAdditionalExeNotFoundWarning": false,

"python.analysis.autoFormatStrings": true,
"python.defaultInterpreterPath": "gazelle/.venv/bin/python",
"python.defaultInterpreterPath": ".venv/bin/python",
"python.languageServer": "Pylance",
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "pytest",
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "gazelle"
version = "0.1.0"
edition = "2021"

[dependencies]
pyo3 = { version = "0.21.2", features = ["extension-module"] }

[lib]
name = "gazelle"
crate-type = ["cdylib"]
14 changes: 0 additions & 14 deletions gazelle/Cargo.toml

This file was deleted.

Empty file removed gazelle/python/__init__.py
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions gazelle/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "gazelle"
version = "0.1.0"
readme = "../README.md"
readme = "README.md"
license = "AGPL-3.0-or-later"
documentation = "https://docs.gazelle.sh"
description = "A fast, open-source engine for civil engineers."
repository = "https://github.com/gazellekit/gazelle.git"
authors = ["James S. Bayley <https://www.linkedin.com/in/jsbayley>"]
description = "A fast, open-source engine for civil engineers."
packages = [{ include = "python" }]
classifiers = [
"Programming Language :: Rust",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions python/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import gazelle as gz

__doc__ = gz.__doc__
if hasattr(gz, "__all__"):
__all__ = gz.__all__
2 changes: 1 addition & 1 deletion gazelle/python/main.py → python/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gazelle as gz
from python.steel import SteelFabricator, SectionCategory, UniversalBeam
from .steel import SteelFabricator, SectionCategory, UniversalBeam

print("Welcome to Gazelle! 🦌")
print(f'The answer is: {gz.sum_as_string(10, 32)}')
Expand Down
4 changes: 2 additions & 2 deletions gazelle/python/steel.py → python/steel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# Gazelle: A fast engine for civil engineering design.
# Gazelle: A fast, open-source engine for civil engineers.
# Copyright (C) 2024 James S. Bayley

"""
Expand All @@ -17,7 +17,7 @@
from enum import Enum
from typing import Generic, NewType, Tuple, TypeVar, Union

from python.units import (
from .units import (
Area,
Carbon,
Centimetre,
Expand Down
2 changes: 1 addition & 1 deletion gazelle/python/units.py → python/units.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# Gazelle: A fast engine for civil engineering design.
# Gazelle: A fast, open-source engine for civil engineers.
# Copyright (C) 2024 James S. Bayley


Expand Down
1 change: 1 addition & 0 deletions gazelle/rust/lib.rs → src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
/// import the module.
#[pymodule]
#[pyo3(name="gazelle")]
fn gazelle(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
Ok(())
Expand Down

0 comments on commit c51199d

Please sign in to comment.