Skip to content

Commit

Permalink
Add python 3.12 (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
thom-at-redhat authored Jul 26, 2024
1 parent 1509fb1 commit 6377f15
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy
env:
DESIRED_GO_VERSION: '1.20'
DESIRED_GOLANGCI_LINT_VERSION: 'v1.56'
DESIRED_PYTHON_VERSION: '3.11'
DESIRED_PYTHON_VERSION: '3.12'

jobs:
lint-receptor:
Expand Down Expand Up @@ -103,10 +103,10 @@ jobs:
# NOTE: The highest and the lowest versions come
# NOTE: first as their statuses are most likely to
# NOTE: signal problems early:
- 3.11
- 3.12
- 3.8
- >-
3.10
- 3.11
- "3.10"
- 3.9
uses: ./.github/workflows/reusable-nox.yml
with:
Expand All @@ -125,7 +125,7 @@ jobs:
- check_format
uses: ./.github/workflows/reusable-nox.yml
with:
python-version: '3.11'
python-version: '3.12'
session: ${{ matrix.session }}

container:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ receptor.exe
receptor.app
recepcert
/net
receptorctl-test-venv/
.container-flag*
.VERSION
kubectl
/receptorctl/.nox
/receptorctl/.VERSION
/receptorctl/AUTHORS
/receptorctl/ChangeLog
/receptor-python-worker/.VERSION
/receptor-python-worker/ChangeLog
/receptor-python-worker/AUTHORS
/receptorctl/venv/
receptorctl-test-venv/
.vagrant/
/docs/build
/dist
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ kubectl:
lint:
@golint cmd/... pkg/... example/...

receptorctl-lint: receptorctl/.VERSION
receptorctl-lint: receptor receptorctl/.VERSION
@cd receptorctl && nox -s lint

format:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Receptor
========
# Receptor

[![codecov](https://codecov.io/gh/ansible/receptor/branch/devel/graph/badge.svg?token=RAW5Bvh3hM)](https://codecov.io/gh/ansible/receptor)

Receptor is an overlay network intended to ease the distribution of work across a large and dispersed collection of workers. Receptor nodes establish peer-to-peer connections with each other via existing networks. Once connected, the Receptor mesh provides datagram (UDP-like) and stream (TCP-like) capabilities to applications, as well as robust unit-of-work handling with resiliency against transient network failures.

See the readthedocs page for Receptor at:

https://ansible.readthedocs.io/projects/receptor/
<https://ansible.readthedocs.io/projects/receptor/>

## Terminology and Concepts

Expand All @@ -24,7 +23,8 @@ https://ansible.readthedocs.io/projects/receptor/
## How to Get It

The easiest way to check out Receptor is to run it as a container. Images are kept on the Quay registry. To use this, run:
```

```bash
[docker|podman] pull quay.io/ansible/receptor
[docker|podman] run -d -v /path/to/receptor.conf:/etc/receptor/receptor.conf:Z receptor
```
Expand All @@ -33,8 +33,8 @@ The easiest way to check out Receptor is to run it as a container. Images are k

This code can be imported and used from Go programs. The main libraries are:

* _Netceptor_: https://pkg.go.dev/github.com/ansible/receptor/pkg/netceptor
* _Workceptor_: https://pkg.go.dev/github.com/ansible/receptor/pkg/workceptor
* _Netceptor_: <https://pkg.go.dev/github.com/ansible/receptor/pkg/netceptor>
* _Workceptor_: <https://pkg.go.dev/github.com/ansible/receptor/pkg/workceptor>

See the `example/` directory for examples of using these libraries from Go.

Expand All @@ -46,7 +46,7 @@ The command line is organized into entities which take parameters, like: `recept

Receptor can also take its configuration from a file in YAML format. The allowed directives are the same as on the command line, with a top-level list of entities and each entity receiving zero or more parameters as a dict. The above command in YAML format would look like this:

```
```bash
---
- entity1:
param1: value1
Expand All @@ -58,4 +58,4 @@ Receptor can also take its configuration from a file in YAML format. The allowe

## Python Receptor and the 0.6 versions

As of June 25th, this repo is the Go implementation of Receptor. If you are looking for the older Python version of Receptor, including any 0.6.x version, it is now located at https://github.com/project-receptor/python-receptor.
As of June 25th, this repo is the Go implementation of Receptor. If you are looking for the older Python version of Receptor, including any 0.6.x version, it is now located at <https://github.com/project-receptor/python-receptor>.
12 changes: 6 additions & 6 deletions packaging/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM quay.io/centos/centos:stream9 as builder
ARG VERSION

RUN dnf -y update && \
dnf install -y golang make python3.11 python3.11-pip git
RUN pip3.11 install wheel
dnf install -y golang make python3.12 python3.12-pip git
RUN pip3.12 install wheel

ADD source.tar.gz /source
WORKDIR /source
Expand All @@ -22,11 +22,11 @@ COPY receptor_python_worker-${VERSION}-py3-none-any.whl /tmp
COPY receptor.conf /etc/receptor/receptor.conf

RUN dnf -y update && \
dnf -y install python3.11-pip && \
dnf -y install python3.12-pip && \
dnf clean all && \
pip3.11 install --no-cache-dir wheel && \
pip3.11 install --no-cache-dir dumb-init && \
pip3.11 install --no-cache-dir /tmp/*.whl && \
pip3.12 install --no-cache-dir wheel && \
pip3.12 install --no-cache-dir dumb-init && \
pip3.12 install --no-cache-dir /tmp/*.whl && \
rm /tmp/*.whl

COPY --from=builder /source/receptor /usr/bin/receptor
Expand Down
18 changes: 10 additions & 8 deletions receptorctl/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Receptorctl

Receptorctl is a front-end CLI and importable Python library that interacts with Receptor over its control socket interface.

# Setting up nox
## Setting up nox

This project includes a `nox` configuration to automate tests, checks, and other functions in a reproducible way using isolated environments.
Before you submit a PR, you should install `nox` and verify your changes.
Expand All @@ -21,7 +23,7 @@ You can use unpinned dependencies as follows:
PINNED=false nox -s lint
```

# Checking changes to Receptorctl
## Checking changes to Receptorctl

Run the following `nox` sessions to check for code style and formatting issues:

Expand Down Expand Up @@ -49,7 +51,7 @@ Run the following `nox` sessions to check for code style and formatting issues:
nox -s format
```

# Running Receptorctl tests
## Running Receptorctl tests

Run the following `nox` sessions to test Receptorctl changes:

Expand All @@ -62,24 +64,24 @@ Run the following `nox` sessions to test Receptorctl changes:
* Run tests against a specific Python version.

```bash
# For example, this command tests Receptorctl against Python 3.11.
nox -s tests-3.11
# For example, this command tests Receptorctl against Python 3.12.
nox -s tests-3.12
```

# Updating dependencies
## Updating dependencies

Update dependencies in the `requirements` directory as follows:

1. Add any packages or pins to the `*.in` file.
2. Do one of the following from the `receptorctl` directory:

- Update all dependencies.
* Update all dependencies.

```bash
nox -s pip-compile
```

- Generate the full dependency tree for a single set of dependencies, for example:
* Generate the full dependency tree for a single set of dependencies, for example:

```bash
nox -s "pip-compile-3.12(tests)"
Expand Down
6 changes: 3 additions & 3 deletions receptorctl/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import nox.command

LATEST_PYTHON_VERSION = ["3.11"]
LATEST_PYTHON_VERSION = ["3.12"]

python_versions = ["3.8", "3.9", "3.10", "3.11"]
python_versions = ["3.8", "3.9", "3.10", "3.11", "3.12"]

LINT_FILES: tuple[str, ...] = (*iglob("**/*.py"),)
PINNED = os.environ.get("PINNED", "true").lower() in {"1", "true"}
Expand Down Expand Up @@ -120,7 +120,7 @@ def lint(session: nox.Session):
session.notify("check_format")


@nox.session(name="pip-compile", python=["3.11"])
@nox.session(name="pip-compile", python=["3.12"])
@nox.parametrize(["req"], arg_values_list=requirements_files, ids=requirements_files)
def pip_compile(session: nox.Session, req: str):
"""Generate lock files from input files or upgrade packages in lock files."""
Expand Down
2 changes: 1 addition & 1 deletion tests/environments/container-builder/Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/centos/centos:stream9

# Python options = [3.9, 3.11, 3.12]
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12

ENV PATH=${PATH}:/usr/local/go/bin

Expand Down

0 comments on commit 6377f15

Please sign in to comment.