Skip to content

Commit

Permalink
updated repo structure
Browse files Browse the repository at this point in the history
trying to mypyc
  • Loading branch information
o-murphy committed Aug 19, 2024
1 parent b3ccb52 commit 9da91ac
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 796 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Build cython modules
run: |
cd py_ballisticcalc_exts
cd ./py_ballisticcalc.exts
python setup.py build_ext --inplace
cd ..
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Build binary python package
run: |
cd py_ballisticcalc_exts
cd ./py_ballisticcalc.exts
python -m build --sdist --outdir ../dist
cibuildwheel --output-dir ../dist
cd ..
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Build binary python package
run: |
cd py_ballisticcalc_exts
cd ./py_ballisticcalc.exts
python -m build --sdist --outdir ../dist
cibuildwheel --output-dir ../dist
cd ..
Expand Down
822 changes: 72 additions & 750 deletions Example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion py_ballisticcalc.exts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "py_ballisticcalc.exts"
version = "2.0.4"
version = "2.0.5a1"

authors = [
{ name="o-murphy", email="[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion py_ballisticcalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
import sys
from typing import Dict, Union, Optional
from typing_extensions import Dict, Union, Optional

from .backend import *
from .conditions import *
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Copyright 2024 David Bookstaber (https://github.com/dbookstaber)

[build-system]
requires = ["setuptools", "wheel", "mypy[mypyc]"]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"


[project]
name = "py_ballisticcalc"
version = "2.0.4"
version = "2.0.5a1"

authors = [
{ name="o-murphy", email="[email protected]" },
Expand Down Expand Up @@ -51,7 +51,7 @@ exclude = ["py_ballisticcalc_exts*"]


[project.optional-dependencies]
exts = ['py_ballisticcalc.exts==2.0.4']
exts = ['py_ballisticcalc.exts==2.0.5a1']
charts = ['matplotlib', 'pandas']
dev = [
'jupyter',
Expand Down
40 changes: 2 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,7 @@
# #!/usr/bin/env python
#!/usr/bin/env python

"""setup.py script for py_ballisticcalc library"""

import warnings

from setuptools import setup
from mypyc.build import mypycify

from distutils import ccompiler
from distutils.errors import DistutilsError


def check_compiler():
try:
comp = ccompiler.new_compiler(dry_run=True)
comp.compile([])
return True
except DistutilsError as err:
warnings.warn("Can't compile c-extension due to: {err}")
warnings.warn("Continue installation in pure python mode")
return False


setup(
ext_modules=mypycify(
[
'py_ballisticcalc/',
'--exclude',
'py_ballisticcalc/__init__.py',
'--exclude',
'py_ballisticcalc/unit.py',
'--exclude',
'py_ballisticcalc/conditions.py',
'--exclude',
'py_ballisticcalc/munition.py',
'--exclude',
'py_ballisticcalc/trajectory_data.py',
'--exclude',
'py_ballisticcalc/example.py'
],
) if check_compiler() else None
)
setup()

0 comments on commit 9da91ac

Please sign in to comment.