Skip to content

Commit

Permalink
disabled setup for now
Browse files Browse the repository at this point in the history
  • Loading branch information
enzbus committed Apr 27, 2024
1 parent ceb574b commit 44fb8b2
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 43 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:

packaging:
testing:

runs-on: ubuntu-latest

Expand All @@ -25,19 +25,5 @@ jobs:
with:
python-version: '3.11'

- name: Package
run: |
python -m pip install build
python -m build
- name: Install wheel
run: |
python -m pip install dist/*.whl
- name: Delete the repo
run: |
rm -rf *
- name: Run tests shipped with the package
run: |
python -m project_euromir.tests
- name: Test using makefile
run: make test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ htmlcov/

# C extensions
*.so
*.dylib
*.dll

# misc
.DS_Store
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.10.1)
project(project_euromir)
set(src "project_euromir")
set(linear_algebra_src "project_euromir/linear_algebra.c")
add_library(linear_algebra SHARED ${linear_algebra_src})
set(SRC
project_euromir/linear_algebra.c
)
add_library(project_euromir SHARED ${SRC})
3 changes: 1 addition & 2 deletions DISABLED_PY_PROJECT.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ dependencies = ['numpy', 'scipy']
[project.optional-dependencies]
docs = ["sphinx"]
dev = [
"build", "twine", "pylint", "isort", "autopep8", "docformatter", "numpy",
"scipy"]
"build", "twine", "pylint", "isort", "autopep8", "docformatter"]

[build-system]
requires = ["setuptools", "cmake"]
Expand Down
File renamed without changes.
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ endif

.PHONY: env clean update test lint docs fix release build

env: ## create environment
$(PYTHON) -m venv $(VENV_OPTS) $(ENVDIR)
$(BINDIR)/python -m pip install .[dev,docs]
# env: build ## create environment
# $(PYTHON) -m venv $(VENV_OPTS) $(ENVDIR)
# $(BINDIR)/python -m pip install numpy scipy

build: ## build locally (instead of editable install)
cmake -S . -B $(BUILDDIR)
cmake -B$(BUILDDIR)
cmake --build $(BUILDDIR)
cp $(BUILDDIR)/*.so $(PROJECT)/
cp $(BUILDDIR)/*.so $(PROJECT)/ || true
cp $(BUILDDIR)/*.dylib $(PROJECT)/ || true
cp $(BUILDDIR)/*.dll $(PROJECT)/ || true


clean: ## clean environment
-rm -rf $(DOCBUILDDIR)/*
Expand All @@ -59,10 +62,10 @@ fix: ## auto-fix Python code
# this is the best found for the purpose
docformatter -r --in-place $(PROJECT)

release: update lint test ## update version, publish to PyPI
python -m build
twine check dist/*
# twine upload --skip-existing dist/*
# release: update lint test ## update version, publish to PyPI
# python -m build
# twine check dist/*
# twine upload --skip-existing dist/*

# Thanks to Francoise at marmelab.com for this
.DEFAULT_GOAL := help
Expand Down
16 changes: 4 additions & 12 deletions project_euromir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,10 @@

__version__ = '0.0.1'
import pathlib
import platform
from ctypes import cdll

if platform.system() == 'Linux':
_ext = 'so'
elif platform.system() == 'Windows':
_ext = 'dll'
elif platform.system() == 'Darwin':
_ext = 'dylib'
for fname in pathlib.Path(__file__).parent.iterdir():
if fname.suffix in ['.so', '.dll', '.dylib']:
LIBRARY = cdll.LoadLibrary(fname)

_libname = str(pathlib.Path(__file__).with_name('liblinear_algebra.' + _ext))

linear_algebra = cdll.LoadLibrary(_libname)

assert hasattr(linear_algebra, 'csc_matvec')
assert hasattr(LIBRARY, 'csc_matvec')
Binary file added project_euromir/libproject_euromir.so
Binary file not shown.

0 comments on commit 44fb8b2

Please sign in to comment.