Skip to content

Commit

Permalink
Updated setup.py -> pyproject.toml with poetry build backend. Fully d…
Browse files Browse the repository at this point in the history
…efined package dependencies.

Removed --validate tests.

Added scripts/build_docs.sh and removed Makefile for /docs. Flattened docs directory.

Removed setup.py in favor of pyproject.toml and poetry build system.

Removed LGTM and travis-ci code.
  • Loading branch information
coltonbh committed Mar 30, 2023
1 parent 86b4700 commit 7224657
Show file tree
Hide file tree
Showing 64 changed files with 1,182 additions and 3,076 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<!-- Provide a brief single sentence for the changelog. -->

## Status
<!-- Please `pip install .[lint]; make format` in the base folder. -->
<!-- Please `poetry install; bash scripts/format.sh` in the base folder. -->
- [ ] Code base linted
- [ ] Ready to go
23 changes: 12 additions & 11 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.11]
python-version: ["3.7", "3.11"]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -20,12 +20,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Checkout Code
uses: actions/checkout@v3
- name: Install QCElemental
run: python -m pip install '.[tests]'
- name: Install poetry
run: pip install poetry
- name: Install repo
run: poetry install --no-interaction --no-ansi
- name: Run tests
run: pytest -rws -v --cov=qcelemental --color=yes --cov-report=xml qcelemental
- name: Run pytest validate
run: pytest -rws -v --color=yes --validate qcelemental
run: poetry run pytest -rws -v --cov=qcelemental --color=yes --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3 # NEEDS UPDATE TO v3 https://github.com/codecov/codecov-action
- name: QCSchema Examples Deploy
Expand All @@ -47,14 +47,15 @@ jobs:
name: Set up Python
with:
python-version: "3.7"
- name: Install poetry
run: pip install poetry
- name: Install repo
run: poetry install --no-interaction --no-ansi
- name: Build Documentation
run: |
python -m pip install '.[docs]'
cd docs
make html
run: bash scripts/build_docs.sh
- name: GitHub Pages Deploy
uses: JamesIves/github-pages-deploy-action@4.1.1
if: github.event_name == 'push' && github.repository == 'MolSSI/QCElemental' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' )
with:
branch: gh-pages
folder: docs/build/html
folder: build/docs/
10 changes: 6 additions & 4 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install black
run: pip install black
- name: Check code formatting with black
run: black --check qcelemental devtools
run: black --check .

isort:
runs-on: ubuntu-latest
Expand All @@ -28,10 +28,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install poetry
run: pip install poetry
- name: Install repo
run: pip install -e '.[lint]'
run: poetry install --no-interaction --no-ansi
- name: Check import formatting with isort
run: isort --check-only --diff qcelemental devtools
run: poetry run isort --check-only --diff .
# TODO: Support flake8 when the repo is ready :)
# flake8:
# runs-on: ubuntu-latest
Expand All @@ -44,7 +46,7 @@ jobs:
# - name: Install flake8
# run: pip install flake8
# - name: Flake8
# run: flake8 --count qcelemental devtools
# run: flake8 --count .

# TODO: Support mypy when the repo is ready
# mypy:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ instance/
.scrapy

# Sphinx documentation
docs/build/
docs/source/api/
docs/api/

# PyBuilder
target/
Expand Down Expand Up @@ -120,6 +119,7 @@ runinfo/*
.vscode/
raw_data/**/*_blob.py

# autogen
# QCElemental Specific ignores
qcschema/*.schema
qcelemental/tests/qcschema_instances/*/*.json
poetry.lock
17 changes: 0 additions & 17 deletions .lgtm.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- id: black
# TODO: Support flake8 when the repo is ready
# - repo: https://github.com/PyCQA/flake8
# rev: 6.0.0
# rev: 5.0.4
# hooks:
# - id: flake8
# TODO: Support mypy when the repo is ready
Expand Down
37 changes: 29 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ We welcome contributions from external contributors, and this document describes
git clone https://github.com/{YOUR-GITHUB-USERNAME}/QCElemental.git
cd QCElemental
```
- Create a virtual environment into which you can install QCElemental. Make sure to use Python3.7+. Source this environment to use it for development.
- Install [poetry](https://python-poetry.org/) if you do not have it on your system. Poetry will manage package dependencies and virtual environments for you.
```sh
curl -sSL https://install.python-poetry.org | python3 -
```
- Install QCElemental.

```sh
python -m venv env
source env/bin/activate
poetry install
```

- Install `QCElemental` into this virtual environment and then source the new command line tools. The command below installs QCElemental in "editable" mode--meaning all changes to the code will be instantly available to the python interpreter--and with all associated development tools.
- Activate your new virtual environment. Many editors--like VS Code--will do this for you automatically when you open a directory that has been installed with `poetry`.

```sh
pip install -e '.[docs,tests,align,viz,lint]'
source env/bin/activate
poetry shell
```

- Check your installation by running the tests.

```sh
bash devtools/scripts/test.sh
bash scripts/test.sh
```

- Look at the code coverage by opening the newly created `htmlcov/index.html` in your browser. This can help you evaluate the test coverage of new code that you add.
Expand Down Expand Up @@ -64,13 +66,32 @@ We welcome contributions from external contributors, and this document describes
- Make changes to the code and commit your changes using git. You can lint your code (make sure it adheres to our code guidelines by standardizing code format, import ordering, spacing, etc.) without needing to deal with these details yourself by running:

```sh
bash devtools/scripts/format.sh
bash scripts/format.sh
```

- If you're providing a new feature, you must add test cases and documentation.

- Push to your repo. When you are ready to submit your changes open a [Pull Request](https://github.com/MolSSI/QCElemental/pulls) on the MolSSI/QCElemental repo from your fork into the QCElemental `master` branch. When you're ready to be considered for merging, check the "Ready to go" box on the PR page to let the QCElemental developers know that the changes are complete. The code will not be merged until this box is checked, the continuous integration returns check marks, and multiple core developers give "Approved" reviews.

## Building Docs and Packaging for Distribution

- Build Docs:

```sh
bash scripts/build_docs.sh
```

- Build packages for distribution. Build artifacts will be in `dist/`:

```sh
poetry build
```

- Distribute built packages to PyPi:
```sh
poetry publish --username {pypi_username} --password {pypi_password}
```

## Additional Resources

- [General GitHub documentation](https://help.github.com/)
Expand Down
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

68 changes: 0 additions & 68 deletions Makefile

This file was deleted.

45 changes: 34 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,45 @@

[![Build Status](https://github.com/MolSSI/QCElemental/workflows/CI/badge.svg?branch=master)](https://github.com/MolSSI/QCElemental/actions?query=workflow%3ACI)
[![codecov](https://img.shields.io/codecov/c/github/MolSSI/QCElemental.svg?logo=Codecov&logoColor=white)](https://codecov.io/gh/MolSSI/QCElemental)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/MolSSI/QCElemental.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/MolSSI/QCElemental/context:python)
[![Documentation Status](https://img.shields.io/github/workflow/status/MolSSI/QCElemental/CI/master?label=docs&logo=readthedocs&logoColor=white)](http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/)
[![Chat on Slack](https://img.shields.io/badge/chat-on_slack-green.svg?longCache=true&style=flat&logo=slack)](https://join.slack.com/t/qcarchive/shared_invite/enQtNDIzNTQ2OTExODk0LTE3MWI0YzBjNzVhNzczNDM0ZTA5MmQ1ODcxYTc0YTA1ZDQ2MTk1NDhlMjhjMmQ0YWYwOGMzYzJkZTM2NDlmOGM)
![python](https://img.shields.io/badge/python-3.6+-blue.svg)
![python](https://img.shields.io/badge/python-3.7+-blue.svg)

QCElemental is a resource module for quantum chemistry containing physical
constants and periodic table data from NIST and molecule handlers.
**Documentation:** [Read The Docs](http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/index.html)

Periodic Table and Physical Constants data are pulled from NIST srd144 and
srd121, respectively ([details](raw_data/README.md)) in a renewable manner
(class around NIST-published JSON file).
Core data structures for Quantum Chemistry. QCElemental also contains physical constants and periodic table data from NIST and molecule handlers.

This project also contains a generator, validator, and translator for [Molecule
QCSchema](https://molssi-qc-schema.readthedocs.io/en/latest/auto_topology.html).
Periodic Table and Physical Constants data are pulled from NIST srd144 and srd121, respectively ([details](raw_data/README.md)) in a renewable manner (class around NIST-published JSON file).

It is intended to keep the QCElemental code compatible with Python 3.7+
as long as dependencies allow. Packages are assured for Python 3.8+.
This project also contains a generator, validator, and translator for [Molecule QCSchema](https://molssi-qc-schema.readthedocs.io/en/latest/auto_topology.html).

## ✨ Getting Started

- Installation. QCElemental supports Python 3.7+.

```sh
python -m pip install qcelemental
```

- To install QCElemental with molecule visualization capabilities (useful in iPython or Jupyter notebook environments):

```sh
python -m pip install 'qcelemental[viz]`
```
- To install QCElemental with various alignment capabilities using `networkx`
```sh
python -m pip install 'qcelemental[align]`
```

- Or install both:

```sh
python -m pip install 'qcelemental[viz,align]`
```
- See [documentation](http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/index.html)
### Periodic Table
Expand Down Expand Up @@ -77,6 +98,7 @@ conversion factors can be obtained:
### Covalent Radii
Covalent radii are accessible for most of the periodic table from [Alvarez, Dalton Transactions (2008) doi:10.1039/b801115j](https://doi.org/10.1039/b801115j) ([details](qcelemental/data/alvarez_2008_covalent_radii.py.py)).
```python
>>> import qcelemental as qcel
>>> qcel.covalentradii.get('I')
Expand All @@ -96,6 +118,7 @@ qcelemental.exceptions.DataUnavailableError: ('covalent radius', 'Lv')
### van der Waals Radii
Van der Waals radii are accessible for tmost of the periodic table from [Mantina, J. Phys. Chem. A (2009) doi: 10.1021/jp8111556](https://pubs.acs.org/doi/10.1021/jp8111556) ([details](qcelemental/data/mantina_2009_vanderwaals_radii.py)).
```python
>>> import qcelemental as qcel
>>> qcel.vdwradii.get('I')
Expand Down
41 changes: 0 additions & 41 deletions devtools/README.md

This file was deleted.

Loading

0 comments on commit 7224657

Please sign in to comment.