Skip to content

Commit

Permalink
feat!: public release (#80)
Browse files Browse the repository at this point in the history
Preparing the repository for its public release:
- Update the build script to no longer define a PIP_INDEX_URL -- the environment variable
  that we used to interface with our internal repository during private development.
- Update the code quality check to pull deps from the public PyPI, so
  that we're testing as customers would use it.
- Use the public PyPI in the release flows since all deps are now
  available publicly. This ensures that the artifact we release can be
  built & used by anyone using PyPI.
- Increment the openjd-model dependency to the first publicly available
  version.
- Small additions to the README.

Signed-off-by: Daniel Neilson <[email protected]>
  • Loading branch information
ddneilson authored Feb 13, 2024
1 parent 5419d9b commit 86ef7a7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 60 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ jobs:
permissions:
id-token: write
contents: write
env:
CODEARTIFACT_REGION: "us-west-2"
CODEARTIFACT_DOMAIN: ${{ secrets.CODEARTIFACT_DOMAIN }}
CODEARTIFACT_ACCOUNT_ID: ${{ secrets.CODEARTIFACT_ACCOUNT_ID }}
CODEARTIFACT_REPOSITORY: ${{ secrets.CODEARTIFACT_REPOSITORY }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -90,17 +85,9 @@ jobs:
echo EOF
} >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEARTIFACT_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true

# Tag must be made before building so the generated _version.py files have the correct version
- name: Build
run: |
export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_ACCOUNT_ID }} --query authorizationToken --output text --region us-west-2)
pip install --upgrade hatch
hatch build
Expand Down Expand Up @@ -174,29 +161,26 @@ jobs:
ref: release
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEARTIFACT_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install dependencies
run: |
CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_ACCOUNT_ID }} --query authorizationToken --output text --region us-west-2)
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"
echo CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN >> $GITHUB_ENV
pip install --upgrade hatch
pip install --upgrade twine
- name: Build
run: hatch build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEARTIFACT_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true

- name: Publish to Repository
run: |
export TWINE_USERNAME=aws
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/reuse_python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
env:
PYTHON: ${{ matrix.python-version }}
CODEARTIFACT_REGION: "us-west-2"
CODEARTIFACT_DOMAIN: ${{ secrets.CODEARTIFACT_DOMAIN }}
CODEARTIFACT_ACCOUNT_ID: ${{ secrets.CODEARTIFACT_ACCOUNT_ID }}
CODEARTIFACT_REPOSITORY: ${{ secrets.CODEARTIFACT_REPOSITORY }}
steps:
- uses: actions/checkout@v4
if: ${{ !inputs.branch }}
Expand All @@ -52,27 +48,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEARTIFACT_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true

- name: CodeArtifact Setup Unix
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: |
CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_ACCOUNT_ID }} --query authorizationToken --output text --region us-west-2)
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"
echo CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN >> $GITHUB_ENV
- name: CodeArtifact Setup Windows
if: ${{ matrix.os == 'windows-latest'}}
run: |
$CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_ACCOUNT_ID }} --query authorizationToken --output text --region us-west-2)
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"
echo CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN >> $env:GITHUB_ENV
- name: Install Dependencies
run: pip install --upgrade -r requirements-development.txt

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Open Job Description - Sessions for Python

[![pypi](https://img.shields.io/pypi/v/openjd-sessions.svg)](https://pypi.python.org/pypi/openjd-sessions)

Open Job Description is a flexible open specification for defining render jobs which are portable
between studios and render solutions. This package provides a library that can be used to build
a runtime that is able to run Jobs in a
Expand All @@ -20,6 +22,11 @@ This library requires:
4. On Windows:
* PowerShell 5.x

**EXPERIMENTAL** Note that compatibility with the Windows operating system is currently in active development
and should be considered to be experimental. We recommend that this library not be used in Windows-based
production environments at this time. We will remove this notice when Windows compatibility is considered
sufficiently stable and secure for use in Windows-based production environments.

## Versioning

This package's version follows [Semantic Versioning 2.0](https://semver.org/), but is still considered to be in its
Expand All @@ -30,6 +37,13 @@ versions will increment during this initial development stage, they are describe
2. The MINOR version is currently incremented when backwards incompatible changes are introduced to the public API.
3. The PATCH version is currently incremented when bug fixes or backwards compatible changes are introduced to the public API.

## Contributing

We encourage all contributions to this package. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for our contributing guidelines.

## Example Usage

### Running a Session
Expand Down
6 changes: 0 additions & 6 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ lint = [
[[envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]

[envs.default.env-vars]
PIP_INDEX_URL="https://aws:{env:CODEARTIFACT_AUTH_TOKEN}@{env:CODEARTIFACT_DOMAIN}-{env:CODEARTIFACT_ACCOUNT_ID}.d.codeartifact.{env:CODEARTIFACT_REGION}.amazonaws.com/pypi/{env:CODEARTIFACT_REPOSITORY}/simple/"

[envs.codebuild.scripts]
build = "hatch build"

[envs.codebuild.env-vars]
PIP_INDEX_URL=""

[envs.container.env-vars]

[envs.release]
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ classifiers = [
"Topic :: Software Development :: Libraries"
]
dependencies = [
"openjd-model == 0.3.*",
"openjd-model == 0.4.*",
"pywin32 == 306; platform_system == 'Windows'",
"psutil == 5.9.*; platform_system == 'Windows'",
]

[project.urls]
Homepage = "https://github.com/OpenJobDescription/openjd-specifications/wiki"
Homepage = "https://github.com/OpenJobDescription/openjd-sessions-for-python"
Source = "https://github.com/OpenJobDescription/openjd-sessions-for-python"

[tool.hatch.build]
Expand Down Expand Up @@ -99,15 +99,16 @@ mypy_path = "src"
plugins = "pydantic.mypy"

[tool.ruff]
line-length = 100

[tool.ruff.lint]
ignore = [
"E501",
# Double Check if this should be fixed
"E731",
]
line-length = 100


[tool.ruff.pep8-naming]
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
# pydantic decorators are classmethod decorators
Expand All @@ -116,7 +117,7 @@ classmethod-decorators = [
"pydantic.root_validator",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = [
"openjd",
]
Expand Down

0 comments on commit 86ef7a7

Please sign in to comment.