Skip to content
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build :: clean
python3 setup.py sdist
$(VIRTUAL_ENV)/bin/python3 -m build --sdist --wheel

deploy : build
scp dist/* chablis:/usr/local/www/data/pip3/acsys/
Expand Down
49 changes: 29 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,34 @@ python3 -m pip install acsys --extra-index-url https://www-bd.fnal.gov/pip3

The command above will get you up and going quickly. See usage examples in the [wiki](https://github.com/fermi-controls/acsys-python/wiki).

If you need to perform settings, authentication is required and thus the `gssapi` authentication library.
If you need to perform settings, you will need the optional authentication library, `gssapi`.

```bash
python3 -m pip install "acsys[settings]"
python3 -m pip install "acsys[settings]" --extra-index-url https://www-bd.fnal.gov/pip3
```

Note: This package only authenticates you as a user. There are other requirements to be able to set devices. Please make a request to the Controls Department for setting access.

If you would like to install all dependencies, use the following.
## Building and Distributing

All dependencies are managed via pyproject.toml.

Start by creating and activating a virtual environment.

```bash
python3 -m venv venv
source ./venv/bin/activate
```

To build the project, ensure you have your development dependencies installed.

```bash
python3 -m pip install "acsys[all]"
pip install -e ".[dev]"
```

## Building
This command installs your project in an editable mode along with all its development dependencies, like `build` and `wheel`.

Make sure `setup.py` has the correct version number.
Make sure `pyproject.toml` has the correct version number.

```bash
make
Expand All @@ -46,34 +57,32 @@ make all

The above will generate "built distributions" as well as the source distributions from `make`.

## Deploying

```bash
make deploy
```
## Releasing a New Version

The above will generate the distributions and push them to the AD Controls pip server.
### Set the new version

Make sure to use git to tag the version.
Ensure all your changes are committed to Git. Create a new Git tag for the version you are releasing. The tag name should follow the semver format `vX.Y.Z`.

```bash
git tag vVID
```

And push the tags.
### Deploy the distributions

Run the `deploy` make target to build the package and push it to the pip server. This process will automatically use the new version from your Git tag.

```bash
git push --tags
make deploy
```

## Development
### Push the tags

Start by installing development dependencies.
Finally, push the new tag to the remote repository. This makes the new version official in your project's history.

```bash
pip install -r requirements.txt
git push --tags
```

To test local modifications, use pip's editable mode.
## Development

`pip install -e .`
To get started with development, simply follow the "Building and Distributing" section. The `pip install -e ".[dev]"` command will set up your virtual environment so that any changes you make to the source code will be immediately reflected in your `venv`.
9 changes: 3 additions & 6 deletions acsys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ async def my_client(con):
import struct
import acsys.status as status

# https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-version
try:
from importlib import metadata
except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
import importlib_metadata as metadata

from importlib import metadata


__version__ = metadata.version('acsys')
__all__ = [
Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools>=61.0", "wheel", "setuptools-git-versioning"]
build-backend = "setuptools.build_meta"

[project]
name = "acsys"
dynamic = ["version"]
authors = [
{ name="Rich Neswold", email="neswold@fnal.gov" },
{ name="Beau Harrison", email="beau@fnal.gov" },
]
description = "ACSys Client library"
readme = "README.md"
requires-python = ">=3.9.21"
license = { text = "MIT" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"nest_asyncio",
]

[project.optional-dependencies]
settings = [
"gssapi",
]
dev = [
"build",
"wheel",
]

[tool.setuptools-git-versioning]
enabled = true
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion settings_requirements.txt

This file was deleted.

35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

Loading