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
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Run tests

on:
push:
branches: [ main ]
branches: [ '*' ]
pull_request:
branches: [ main ]

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/python-publish-live.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload the package to Live Registry of PyPI when a release is created.
# The package will be published here: https://pypi.org/project/codeguru-profiler-agent/
# For more information see: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#publishing-to-package-registries

name: Publish to Live PyPI

on:
release:
types: [released]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_LIVE_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine check dist/*
twine upload --verbose dist/*
32 changes: 32 additions & 0 deletions .github/workflows/python-publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will upload the package to Test Registry of PyPI when a pre-release is created.
# The package will be published here: https://test.pypi.org/project/codeguru-profiler-agent/
# For more information see: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#publishing-to-package-registries

name: Publish to Test PyPI

on:
release:
types: [prereleased]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/'
run: |
python setup.py sdist bdist_wheel
twine check dist/*
twine upload --verbose dist/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__/
pytest-report.html
*.egg-info
dist/*
32 changes: 32 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Release

## How to release to PyPI

#### Create PR with the new agent version

- Create a pull request that updates the agent's version number in the source code [here](https://github.com/aws/amazon-codeguru-profiler-python-agent/blob/main/codeguru_profiler_agent/agent_metadata/agent_metadata.py#L12). You can use directly the editor to edit the file and create the PR.

- Get approval from the [amazon-codeguru-profiler team](https://github.com/orgs/aws/teams/amazon-codeguru-profiler).

- Wait until the [``Run tests`` workflow](https://github.com/aws/amazon-codeguru-profiler-python-agent/actions) passes successfully.

#### Publish package to Test PyPI

- Create a [new pre-release](https://github.com/aws/amazon-codeguru-profiler-python-agent/releases/new) with the agent version and details about what is changed, in the format of a changelog as [in previous releases](https://github.com/aws/amazon-codeguru-profiler-python-agent/releases). Make sure you check the box with "pre-release".

- This will trigger a release to the Test Registry of PyPI, and you can track it in the [Actions tab](https://github.com/aws/amazon-codeguru-profiler-python-agent/actions).

- You can use the agent now from the PyPI **Test** registry as [codeguru-profiler-agent](https://test.pypi.org/project/codeguru-profiler-agent/).

#### Publish package to Live PyPI

- If you want to release to the Live registry of PyPI to be used by customers, go to the [Releases tab]([here](https://test.pypi.org/project/codeguru-profiler-agent/) and edit your pre-releases as prod release.

- This will trigger publishing the package to the Live Registry of PyPI, and you can track it in the [Actions tab](https://github.com/aws/amazon-codeguru-profiler-python-agent/actions).

- You can use the agent now from the PyPI **Live** registry as [codeguru-profiler-agent](https://pypi.org/project/codeguru-profiler-agent/).

## How to release the Lambda Layer.

Check internal instructions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Check the GitHub repository at [aws/amazon-codeguru-profiler-python-agent](https

See [CONTRIBUTING](CONTRIBUTING.md) for details.

## How to release to PyPI
## How to release

Use the `setup.py` script to create the archive.
See [DEVELOPMENT](DEVELOPMENT.md) for more information.

## Security

Expand Down
2 changes: 1 addition & 1 deletion codeguru_profiler_agent/agent_metadata/agent_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# NOTE: Please do not alter the value for the following constants without the full knowledge of the use of them.
# These constants are used in several scripts, including setup.py.
__agent_name__ = "CodeGuruProfiler-python"
__agent_version__ = "1.0.1"
__agent_version__ = "1.0.2-dev.1"


def look_up_fleet_info(
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def find_version(*file_paths):
packages=find_packages(exclude=("test",)),

description="The Python agent to be used for Amazon CodeGuru Profiler",
long_description="https://docs.aws.amazon.com/codeguru/latest/profiler-ug/what-is-codeguru-profiler.html",
long_description=read("README.md"),
long_description_content_type="text/markdown",
author="Amazon Web Services",
url="https://github.com/aws/amazon-codeguru-profiler-python-agent",
download_url="https://github.com/aws/amazon-codeguru-profiler-python-agent",
Expand Down