-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the project to use pyproject.toml
- Loading branch information
Showing
12 changed files
with
126 additions
and
78 deletions.
There are no files selected for viewing
File renamed without changes.
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
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
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,3 +1,5 @@ | ||
lib/ | ||
include/ | ||
external.py | ||
|
||
*.dylib | ||
*.so | ||
*.dll |
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
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,22 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "scikit-build"] #, "cmake", "ninja"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
skipsdist = True | ||
[testenv] | ||
; this is required on windows to ensure the compiler finds the standard lib | ||
; files (kernel32.lib, etc.) and headers | ||
passenv = LIB INCLUDE LIBPATH | ||
setenv = | ||
CHFL_PY_INTERNAL_CHEMFILES = 1 | ||
commands = | ||
pip install -e . | ||
discover -p "*.py" tests | ||
deps = | ||
discover | ||
numpy | ||
""" |
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
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,31 @@ | ||
[metadata] | ||
name = chemfiles | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
|
||
license_files = LICENSE | ||
author = Guillaume Fraux | ||
author_email = [email protected] | ||
description = Read and write computational chemistry files | ||
keywords = chemistry computational cheminformatics files formats | ||
url = http://github.com/chemfiles/chemfiles.py | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Environment :: Console | ||
Intended Audience :: Developers | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: BSD License | ||
Operating System :: MacOS :: MacOS X | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: Unix | ||
Programming Language :: Python :: 2 | ||
Programming Language :: Python :: 3 | ||
Topic :: Scientific/Engineering :: Chemistry | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Topic :: Utilities | ||
|
||
[options] | ||
zip_safe = False | ||
|
||
[bdist_wheel] | ||
universal = 1 |
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,9 +1,17 @@ | ||
# -*- coding=utf-8 -*- | ||
import chemfiles | ||
import sys | ||
from wheel.bdist_wheel import bdist_wheel | ||
from skbuild import setup | ||
|
||
import sys | ||
import os | ||
import re | ||
|
||
|
||
# Read the version from chemfiles/__init__.py without importing chemfiles | ||
__version__ = re.search( | ||
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', open("chemfiles/__init__.py").read() | ||
).group(1) | ||
|
||
|
||
class universal_wheel(bdist_wheel): | ||
# Workaround until https://github.com/pypa/wheel/issues/185 is resolved | ||
|
@@ -12,49 +20,48 @@ def get_tag(self): | |
return ("py2.py3", "none") + tag[2:] | ||
|
||
|
||
with open("requirements.txt", "r") as fd: | ||
requirements = list(filter(bool, (line.strip() for line in fd))) | ||
if sys.hexversion >= 0x03040000: | ||
requirements = list(filter(lambda r: r != "enum34", requirements)) | ||
install_requires = ["numpy"] | ||
if sys.hexversion < 0x03040000: | ||
install_requires.append("enum34") | ||
|
||
|
||
# scikit-build options | ||
cmake_args = [] | ||
if sys.platform.startswith("darwin"): | ||
cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9") | ||
|
||
if os.getenv("CHFL_PY_INTERNAL_CHEMFILES"): | ||
cmake_args.append("-DCHFL_PY_INTERNAL_CHEMFILES=ON") | ||
|
||
|
||
def _get_lib_ext(): | ||
if sys.platform.startswith("win32"): | ||
ext = ".dll" | ||
elif sys.platform.startswith("darwin"): | ||
ext = ".dylib" | ||
elif sys.platform.startswith("linux"): | ||
ext = ".so" | ||
else: | ||
raise Exception("Unknown operating system: %s" % sys.platform) | ||
return ext | ||
|
||
long_description = "" | ||
with open("README.md", "r") as fd: | ||
for line in fd: | ||
# remove github badges | ||
if not line.startswith("[!["): | ||
long_description += line | ||
|
||
setup( | ||
name="chemfiles", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
version=chemfiles.__version__, | ||
author="Guillaume Fraux", | ||
author_email="[email protected]", | ||
description="Read and write chemistry trajectory files", | ||
keywords="chemistry computational cheminformatics files formats", | ||
url="http://github.com/chemfiles/chemfiles.py", | ||
packages=["chemfiles"], | ||
zip_safe=False, | ||
install_requires=requirements, | ||
setup_requires=["scikit-build"], | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: Unix", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: Chemistry", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Utilities", | ||
], | ||
cmake_install_dir="chemfiles", | ||
cmake_args=['-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9'], | ||
version=__version__, | ||
install_requires=install_requires, | ||
cmdclass={"bdist_wheel": universal_wheel}, | ||
# cmake_install_dir="chemfiles", | ||
cmake_args=cmake_args, | ||
packages=["chemfiles"], | ||
package_data={ | ||
"chemfiles": [ | ||
"*" + _get_lib_ext(), | ||
"bin/*" + _get_lib_ext(), | ||
] | ||
}, | ||
exclude_package_data={ | ||
"chemfiles": [ | ||
"include/*", | ||
] | ||
}, | ||
) |