Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation with pip #25

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: COBS Python

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
linux_build:
name: Build and test with Python ${{ matrix.python-version }} (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Check out code for the build
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build and test
run: |
pip install .
python -m unittest discover python/tests

mac_build_clang:
name: Build and test with Python ${{ matrix.python-version }} (macOS)
runs-on: macos-13
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install boost-python3

- name: Check out code for the build
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build and test
run: |
pip install .
python -m unittest discover python/tests
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ __pycache__
cobs*.tar
cobs*.tar.gz
!tests/data/non_acgt_test/index.cobs_classic
.devcontainer/
cobs_index.egg-info
*.so
*.bin
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
url = https://github.com/Cyan4973/xxHash.git
[submodule "python/pybind11"]
path = python/pybind11
url = https://github.com/pybind/pybind11.git
url = ../../pybind/pybind11
branch = stable
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
if(NOOPENMP)
message(WARNING "COMPILING WITHOUT OPENMP!")
else()
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(WARNING "OpenMP not found!")
endif()
endif()

# with run-time STL checks
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ COBS requires CMake, a C++17 compiler or the Boost.Filesystem library.

To download and install COBS run:
```
git clone --recursive https://github.com/bingmann/cobs.git
git clone --recursive https://github.com/iqbal-lab-org/cobs.git
mkdir cobs/build
cd cobs/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
```
and optionally run `make test` to check the build.
and optionally run `make test` to check the build. Note that to download submodules, `--recursive` has to be provided.

## OS X compilation

Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools==69.5.1",
"cmake==3.29.2",
]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion python/pybind11
Submodule pybind11 updated 259 files
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def build_extension(self, ext):
build_args += ['--', '/m']
else:
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
build_args += ['--', '-j2']
build_args += ['--']

env = os.environ.copy()
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(
Expand Down