-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from ecrl/update-install
Update install method, update unit tests
- Loading branch information
Showing
10 changed files
with
123 additions
and
111 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Upload new PaDELPy version to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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,26 @@ | ||
name: Run PaDELPy tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
pip install pytest pytest-md | ||
- name: Install package | ||
run: python -m pip install . | ||
- name: Run tests | ||
uses: pavelzw/pytest-action@v2 | ||
with: | ||
emoji: false | ||
report-title: 'PaDELPy test report' |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from .wrapper import padeldescriptor | ||
from .functions import from_mdl, from_smiles, from_sdf | ||
__version__ = '0.1.13' |
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,4 +1,3 @@ | ||
VERSION = (0, 1, 14, "") | ||
import pkg_resources | ||
|
||
__version__ = ".".join(map(str, VERSION[:-1])) | ||
__release__ = ".".join(map(str, VERSION)) | ||
__version__ = pkg_resources.get_distribution("padelpy").version |
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,30 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[project] | ||
name = "padelpy" | ||
version = "0.1.15" | ||
authors = [ | ||
{ name="Travis Kessler", email="travis.j.kessler@gmail.com" }, | ||
] | ||
description = "A Python wrapper for PaDEL-Descriptor software" | ||
readme = "README.md" | ||
requires-python = ">=3.11" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/ecrl/padelpy" | ||
"Bug Tracker" = "https://github.com/ecrl/padelpy/issues" | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = [ | ||
"ignore::DeprecationWarning", | ||
] |
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,34 @@ | ||
import pytest | ||
|
||
from padelpy import from_sdf, from_smiles | ||
|
||
|
||
def test_from_smiles(): | ||
descriptors = from_smiles('CCC') | ||
assert len(descriptors) == 1875 | ||
assert float(descriptors['MW']) == pytest.approx(44.0626, 1e-4) | ||
assert int(descriptors['nC']) == 3 | ||
|
||
|
||
def test_multiple_smiles(): | ||
smiles = ['CCC', 'CCCC'] | ||
descriptors = from_smiles(smiles) | ||
assert len(descriptors) == 2 | ||
assert len(descriptors[0]) == 1875 | ||
|
||
|
||
def test_errors(): | ||
bad_smiles = 'SJLDFGSJ' | ||
with pytest.raises(RuntimeError): | ||
_ = from_smiles(bad_smiles) | ||
bad_smiles = ['SJLDFGSJ', 'CCC'] | ||
with pytest.raises(RuntimeError): | ||
_ = from_smiles(bad_smiles) | ||
|
||
|
||
def test_from_sdf(): | ||
descriptors = from_sdf('tests/aspirin_3d.sdf')[0] | ||
assert len(descriptors) == 1875 | ||
assert float(descriptors['MW']) == pytest.approx(180.04225, 1e-4) | ||
assert float(descriptors['SsCH3']) == pytest.approx(1.2209, 1e-4) | ||
assert int(descriptors['nC']) == 9 |