Skip to content

Commit

Permalink
Merge pull request #65 from nlesc-nano/rel
Browse files Browse the repository at this point in the history
REL: Prepare for a flamingo release on pypi
  • Loading branch information
BvB93 authored Dec 3, 2021
2 parents 13714b7 + 9d41d67 commit 9fe9948
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 67 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2

- name: Install dependencies
run: pip install wheel twine

- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list

- name: Build the package
run: python setup.py sdist bdist_wheel

- name: Publish the package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: ${{ matrix.os }} (py ${{ matrix.version }}${{ matrix.special }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
version: ["3.7", "3.8", "3.9"]
special: [""]
include:
- os: ubuntu-latest
special: "; pre-release"
version: "3.9"
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
update-conda: false

- name: Install dependencies
run: |
conda create -n test -c conda-forge python=${{ matrix.version }} rdkit
source $CONDA/bin/activate test
case "${{ matrix.special }}" in
"; pre-release")
pip install -e .[test,doc] --pre --upgrade --force-reinstall
pip install git+https://github.com/SCM-NV/PLAMS@master --upgrade
;;
*)
pip install -e .[test,doc] ;;
esac
- name: Conda info
run: |
source $CONDA/bin/activate test
conda info
- name: Installed packages
run: conda list -n test

- name: Run tests
run: |
source $CONDA/bin/activate test
pytest
- name: Run codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
name: codecov-umbrella
9 changes: 6 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ Change Log
All notable changes to this project will be documented in this file.
This project adheres to `Semantic Versioning <http://semver.org/>`_.

0.2.2 [Unreleased]

0.3.0 [03/12/2021]
******************
* Release flamingo on pypi (#64)
* Run all the filters in parallel (#38)
* Filter molecules with a single functional group (#43)
* Add interface to cosmo-rs (#5)



0.2.1 [14/01/2021]
******************
Change
-----
* Use all the available CPU to compute bulkiness with CAT by calling the `imap_unordered Pool's method <https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.imap_unordered>`_.
* Remove the `batch_size` input parameter and fix it to 1000.


0.2.0 [03/11/2020]
******************
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Package installation
Finally install the package:

- Install **flamingo** using pip:
- ``pip install git+https://github.com/nlesc-nano/flamingo.git@master``
- ``pip install nlesc-flamingo``

Now you are ready to use *flamingo*.

Expand Down
2 changes: 1 addition & 1 deletion flamingo/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.1"
__version__ = "0.3.0"
11 changes: 7 additions & 4 deletions flamingo/log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@

import logging
import sys
import importlib
from pathlib import Path

import pkg_resources

__all__ = ["configure_logger"]

logger = logging.getLogger(__name__)


def configure_logger(workdir: Path, package_name: str) -> None:
"""Set the logging infrasctucture."""
pkg = sys.modules.get(package_name)
if pkg is None:
pkg = importlib.import_module(package_name)

file_log = workdir / f'{package_name}_output.log'
logging.basicConfig(filename=file_log, level=logging.INFO,
format='%(asctime)s %(message)s',
datefmt='[%I:%M:%S]')
handler = logging.StreamHandler()
handler.terminator = ""

version = pkg_resources.get_distribution(package_name).version
path = pkg_resources.resource_filename(package_name, '')
version = getattr(pkg, "__version__", "UNKNOWN")
path = Path(pkg.__file__).parent

logger.info(f"Using {package_name} version: {version}\n")
logger.info(f"{package_name} path is: {path}\n")
Expand Down
Empty file added flamingo/py.typed
Empty file.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[metadata]
description-file = README.rst
description_file = README.rst
license_file = LICENSE

[aliases]
# Define `python setup.py test`
Expand Down
34 changes: 23 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@

try:
importlib.import_module("rdkit")
importlib.import_module("h5py")
except ModuleNotFoundError:
exc = ModuleNotFoundError(
"""'flamingo' requires the 'rdkit' package: https://anaconda.org/conda-forge/rdkit
and the h5py package: https://anaconda.org/conda-forge/h5py"""
"'flamingo' requires the 'rdkit' package: https://anaconda.org/conda-forge/rdkit"
)
exc.__cause__ = None
raise exc


setup(
name='flamingo',
name='nlesc-flamingo',
version=version['__version__'],
description="Compute and filter molecular properties",
long_description=README + '\n\n',
long_description_content_type='text/x-rst',
author="Felipe Zapata",
author_email='f.zapata@esciencecenter.nl',
url='https://github.com/https://github.com/nlesc-nano/flamingo',
Expand All @@ -48,21 +47,34 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Typing :: Typed',
],
python_requires='>=3.7',
install_requires=[
'CAT@git+https://github.com/nlesc-nano/CAT@master',
'nano-CAT@git+https://github.com/nlesc-nano/nano-CAT@master',
'data-CAT@git+https://github.com/nlesc-nano/data-CAT@master',
'more_itertools', 'numpy', 'pandas',
'pyyaml>=5.1.1', 'schema', 'typing_extensions'],
'nlesc-CAT>=0.10.0',
'nano-CAT>=0.7.0',
'data-CAT>=0.7.0',
'plams>=1.5.1',
'more_itertools',
'numpy',
'pandas',
'pyyaml>=5.1.1',
'schema!=0.7.5',
'typing_extensions',
'h5py',
],
entry_points={
'console_scripts': [
'smiles_screener=flamingo.screen:main'
]
},
package_data={
'flamingo': ['data/scscore/full_reaxys_model_1024bool/model.ckpt-10654.as_numpy.json.gz',
'data/scscore/full_reaxys_model_2048bool/model.ckpt-10654.as_numpy.json.gz']
'flamingo': [
'data/scscore/full_reaxys_model_1024bool/model.ckpt-10654.as_numpy.json.gz',
'data/scscore/full_reaxys_model_2048bool/model.ckpt-10654.as_numpy.json.gz',
'py.typed',
]
},
data_files=[('citation/flamingo', ['CITATION.cff'])],
extras_require={
Expand Down

0 comments on commit 9fe9948

Please sign in to comment.