Skip to content

Commit

Permalink
Move to setup via setup.cfg instead of setup.py (#25)
Browse files Browse the repository at this point in the history
* Move to setup via setup.cfg instead of setup.py

* Delete unnecessary files, adapt README

* adapt test
  • Loading branch information
avaucher authored Aug 4, 2022
1 parent 5c8d015 commit a20fc97
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 67 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
with:
python-version: 3.7
- name: Install dependencies
run: pip install -e .
run: pip install -e .[dev]
- name: Install RDKit
run: pip install rdkit
- name: Install test dependencies
run: pip install -r dev_requirements.txt
- name: Check black
run: python -m black --check --diff --color .
- name: Check isort
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ Enable robust atom mapping on valid reaction SMILES. The atom-mapping informatio
- [Unsupervised attention-guided atom-mapping preprint](http://dx.doi.org/10.26434/chemrxiv.12298559): presented at the ML Interpretability for Scientific Discovery ICML workshop, 2020.

## Installation
For all installations, we recommend using `conda` to get the necessary `rdkit` dependency:

### From pip
```console
conda create -n rxnmapper python=3.6 -y
conda activate rxnmapper
conda install -c rdkit rdkit=2020.03.3.0
pip install rxnmapper
```

Expand All @@ -22,10 +20,24 @@ You can install the package and setup the environment directly from github using
```console
git clone https://github.com/rxn4chemistry/rxnmapper.git
cd rxnmapper
conda env create -f environment.yml
conda create -n rxnmapper python=3.6 -y
conda activate rxnmapper
pip install -e .
pip install -r requirements.txt
```

### RDkit

In both installation settings above, the `RDKit` dependency is not installed automatically.
It can be installed via Conda or Pypi:

```bash
# Install RDKit from Conda
conda install -c conda-forge rdkit

# Install RDKit from Pypi
pip install rdkit
# for Python<3.7
# pip install rdkit-pypi
```

## Usage
Expand All @@ -52,7 +64,7 @@ The results contain the mapped reactions and confidence scores:

You can run the examples above with the test suite as well:

1. `pip install -r dev_requirements.txt`
1. In your Conda environment: `pip install -e .[dev]`
2. `pytest tests` from the root

## Examples
Expand Down
7 changes: 0 additions & 7 deletions dev_requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions environment.yml

This file was deleted.

4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion rxnmapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""rxnmapper initialization."""
__name__ = "rxnmapper"
__version__ = "0.1.0"
__version__ = "0.1.4"

from .core import RXNMapper # noqa
47 changes: 45 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
# Inside of setup.cfg
[metadata]
description-file = README.md
name = rxnmapper
version = attr: rxnmapper.__version__
description = Reaction atom-mapping from transfomers
author = IBM RXN team
author_email = [email protected]
license = MIT
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Operating System :: OS Independent
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Software Development :: Libraries :: Python Modules
url = https://github.com/rxn4chemistry/rxnmapper

[options]
packages = find:
python_requires = >= 3.6
zip_safe = False
include_package_data = True
install_requires =
pandas>=1.0.3
rxn-chem-utils>=1.0.3
scipy==1.4.1
torch==1.5.0
transformers==4.0.0

[options.package_data]
rxnmapper =
models/transformers/albert_heads_8_uspto_all_1310k/*

[options.extras_require]
dev =
black>=22.1.0
bump2version>=1.0.1
flake8>=3.7.9
isort>=5.10.0
pytest>=5.4.1
sphinx-rtd-theme==0.4.3
sphinx==2.2.1
twine==3.1.1

[flake8]
extend-ignore = E203, E501
40 changes: 2 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,5 @@
#!/usr/bin/env python

import os
from setuptools import setup

from setuptools import find_packages, setup

if os.path.exists("README.md"):
long_description = open("README.md").read()
else:
long_description = """Reaction atom-mapping from transfomers"""

setup(
name="rxnmapper",
version="0.1.4",
author="RXNMapper team",
author_email="[email protected], [email protected]",
py_modules=["rxnmapper"],
description="Reaction atom-mapping from transfomers",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
install_requires=[
"transformers==4.0.0",
"torch==1.5.0",
"scipy==1.4.1",
"rxn-chem-utils>=1.0.3",
],
packages=find_packages(),
package_data={
"rxnmapper": ["models/transformers/albert_heads_8_uspto_all_1310k/*"]
},
url="https://github.com/rxn4chemistry/rxnmapper",
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
setup()

0 comments on commit a20fc97

Please sign in to comment.