-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nlwpy: Include nlwpy.test as submodule
- Loading branch information
1 parent
c61c0cb
commit fec6395
Showing
9 changed files
with
57 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
*.so | ||
dist/ | ||
build/ | ||
__pycache__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, AMPL Optimization inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
recursive-include include *.h *.hpp | ||
recursive-include nlwpy *.py | ||
include LICENSE |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# nlwpy tests | ||
# $ pytest --pyargs nlwpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import pytest | ||
|
||
pytest.main(["--pyargs", "nlwpy.test"]) |
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
# Available at setup time due to pyproject.toml | ||
from pybind11.setup_helpers import build_ext | ||
from setuptools import setup, Extension | ||
import pybind11 | ||
import glob | ||
import os | ||
|
||
__version__ = "0.0.1b0" | ||
|
||
# The main interface is through Pybind11Extension. | ||
# * You can add cxx_std=11/14/17, and then build_ext can be removed. | ||
# * You can set include_pybind11=false to add the include directory yourself, | ||
# say from a submodule. | ||
# | ||
# Note: | ||
# Sort input source files if you glob sources to ensure bit-for-bit | ||
# reproducible builds (https://github.com/pybind/python_example/pull/53) | ||
|
||
|
||
def compile_args(): | ||
from platform import system | ||
|
@@ -40,8 +31,26 @@ def compile_args(): | |
return [] | ||
|
||
|
||
def ls_dir(base_dir): | ||
return [ | ||
os.path.join(dirpath, fname) | ||
for (dirpath, dirnames, files) in os.walk(base_dir) | ||
for fname in files | ||
] | ||
|
||
|
||
def package_content(): | ||
files = ls_dir("nlwpy/") | ||
return [ | ||
fpath.replace("nlwpy/", "", 1) | ||
for fpath in files | ||
if "__pycache__" not in fpath and fpath.endswith(".py") | ||
] | ||
|
||
|
||
setup( | ||
name="nlwpy", | ||
license="BSD-3", | ||
version=__version__, | ||
author="Gleb Belov", | ||
author_email="[email protected]", | ||
|
@@ -58,10 +67,8 @@ def compile_args(): | |
define_macros=[("VERSION_INFO", __version__)], | ||
), | ||
], | ||
package_data={"": package_content()}, | ||
extras_require={"test": "pytest"}, | ||
# Currently, build_ext only provides an optional "highest supported C++ | ||
# level" feature, but in the future it may provide more features. | ||
cmdclass={"build_ext": build_ext}, | ||
zip_safe=False, | ||
python_requires=">=3.7", | ||
) |