Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor from setup.py to pyproject.toml #951

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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