Skip to content

Commit

Permalink
Merge pull request #951 from BCDA-APS/914-pyproject.toml
Browse files Browse the repository at this point in the history
Refactor from setup.py to pyproject.toml
  • Loading branch information
prjemian authored Mar 20, 2024
2 parents a165d24 + 11995ec commit 0f4644b
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 262 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
echo "SRC_DIR=$(pwd)" >> ${GITHUB_ENV}
echo "TMP_DIR=$(mktemp -d)" >> ${GITHUB_ENV}
# next step also creates _version.py file
echo "VERSION=$(./setup.py --version)" >> ${GITHUB_ENV}
echo "VERSION=$(python -m setuptools_scm)" >> ${GITHUB_ENV}
- name: Show Environment variables
run: |
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Info
run: |
set -vxeuo pipefail
set -vxeuo pipefail
cd "${TMP_DIR}"
echo "pwd=$(pwd)"
ls -laFGh
Expand Down
81 changes: 0 additions & 81 deletions .ruff.toml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Maintenance

* Code format conforms to 'ruff'.
* Add additional support for APS Data Management API.
* Refactor packaging from setup.py to pyproject.toml.

1.6.18
******
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# apstools

Various Python tools for use with the Bluesky framework at the APS.
Library of Python tools for use with the Bluesky framework at the APS.

GH tag | GH release | PyPI | conda-forge
--- | --- | --- | ---
Expand All @@ -17,7 +17,7 @@ item | description
------------------|--------------------------------
**author** | Pete R. Jemian
**email** | jemian@anl.gov
**copyright** | 2017-2023, UChicago Argonne, LLC
**copyright** | 2017-2024, UChicago Argonne, LLC
**documentation** | versions: [latest tagged release](https://bcda-aps.github.io/apstools/latest/) or [development (main branch)](https://bcda-aps.github.io/apstools/dev/)
**source** | https://github.com/BCDA-APS/apstools

Expand Down
21 changes: 12 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@

# -- Path setup --------------------------------------------------------------

import configparser
from importlib.metadata import version
import json
import pathlib
import sys
import tomllib

sys.path.insert(0, str(pathlib.Path().absolute().parent.parent))
import apstools
import apstools # noqa

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

root_path = pathlib.Path(__file__).parent.parent.parent
parser = configparser.ConfigParser()
parser.read(root_path / "setup.cfg")
metadata = parser["metadata"]

with open(root_path / "pyproject.toml", "rb") as fp:
toml = tomllib.load(fp)
metadata = toml["project"]

gh_org = "BCDA-APS"
project = metadata["name"]
copyright = metadata["copyright"]
author = metadata["author"]
copyright = toml["tool"]["copyright"]["copyright"]
author = metadata["authors"][0]["name"]
description = metadata["description"]
rst_prolog = f".. |author| replace:: {author}"
github_url = f"https://github.com/{gh_org}/{project}"

# -- Special handling for version numbers ------------------------------------
# https://github.com/pypa/setuptools_scm#usage-from-sphinx

gh_org = "BCDA-APS"
release = apstools.__version__
release = version(project)
version = ".".join(release.split(".")[:2])

# fmt: off
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apstools
========

Various Python tools for use with Bluesky at the APS
Library of Python tools for use with Bluesky at the APS

.. toctree::
:maxdepth: 1
Expand Down
12 changes: 2 additions & 10 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,10 @@ GitHub repository listed above::

$ git clone http://github.com/BCDA-APS/apstools.git

To install in the standard Python location::
To install from the source directory using ``pip`` in editable mode::

$ cd apstools
$ python setup.py install

To install in user's home directory::

$ python setup.py install --user

To install in an alternate location::

$ python setup.py install --prefix=/path/to/installation/dir
$ python -m pip install -e .

Required Libraries
##################
Expand Down
2 changes: 1 addition & 1 deletion docs/source/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Package Information
version |version|
release |release|
published |today|
copyright 2017-2022, UChicago Argonne, LLC
copyright 2017-2024, UChicago Argonne, LLC
license ANL OPEN SOURCE LICENSE (see LICENSE.txt file)
author Pete R. Jemian <jemian@anl.gov>
============= ========================================
Expand Down
Loading

0 comments on commit 0f4644b

Please sign in to comment.