-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add PyPI release workflows and project metadata (#149)
- Loading branch information
Showing
13 changed files
with
417 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Description | ||
<!-- Describe your changes in detail --> | ||
|
||
## How Has This Been Tested? | ||
<!-- Please describe how you tested your changes --> | ||
- [ ] Unit tests (`pytest tests/`) | ||
- [ ] Integration tests (if applicable) | ||
|
||
|
||
## Configuration Changes | ||
<!-- Note any changes to configuration files or environment variables --> | ||
- [ ] No config changes | ||
- [ ] Config changes (please describe): | ||
|
||
## Type of Change | ||
<!-- Check relevant options --> | ||
- [ ] Bug fix | ||
- [ ] New feature | ||
- [ ] Documentation update | ||
- [ ] Performance improvement | ||
- [ ] Code cleanup/refactor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This workflows will upload a Python Package using Twine as nightly release | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Nightly PyPI Release | ||
|
||
on: | ||
schedule: | ||
- cron: '59 8 * * *' # Runs at 08:59 UTC every day | ||
workflow_dispatch: # Manual trigger for testing | ||
|
||
jobs: | ||
nightly_release: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'autogluon/autogluon-assistant' | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.CICD_PAT }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Update version for nightly | ||
run: | | ||
current_version=$(grep -A10 '^\[project\]' pyproject.toml | grep '^version = ' | cut -d'"' -f2) | ||
nightly_version="${current_version}.dev$(TZ=America/Los_Angeles date +'%Y%m%d')" | ||
perl -pi -e "s/version = \"${current_version}\"/version = \"${nightly_version}\"/" pyproject.toml | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
skip-existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Official PyPI Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
pypi_release: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'autogluon/autogluon-assistant' | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.CICD_PAT }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
skip-existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Test PyPI Release | ||
|
||
# This workflow is for testing package releases on TestPyPI before official releases | ||
# It automatically adds a unique suffix to the version to avoid conflicts | ||
# since PyPI doesn't allow re-uploading the same version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.CICD_PAT }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
# Modify version to avoid conflicts on TestPyPI | ||
# Format: {version}dev{timestamp} e.g. 0.0.3dev202311190145 | ||
# This ensures each test upload has a unique version number | ||
- name: Set test version | ||
run: | | ||
# Extract current version from pyproject.toml | ||
VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d'"' -f2) | ||
# Add timestamp to make version unique | ||
TEST_VERSION="${VERSION}dev$(date +%Y%m%d%H%M)" | ||
# Update version in pyproject.toml | ||
sed -i "s/version = \"${VERSION}\"/version = \"${TEST_VERSION}\"/" pyproject.toml | ||
echo "Package version set to ${TEST_VERSION}" | ||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build wheel | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
skip-existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Code of Conduct | ||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). | ||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact | ||
[email protected] with any additional questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Contributing Guidelines | ||
|
||
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional | ||
documentation, we greatly value feedback and contributions from our community. | ||
|
||
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary | ||
information to effectively respond to your bug report or contribution. | ||
|
||
|
||
## Reporting Bugs/Feature Requests | ||
|
||
We welcome you to use the GitHub issue tracker to report bugs or suggest features. | ||
|
||
When filing an issue, please check [existing open](https://github.com/autogluon/autogluon-assistant/issues), or [recently closed](https://github.com/autogluon/autogluon-assistant/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already | ||
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: | ||
|
||
* A reproducible test case or series of steps | ||
* The version of autogluon.assistant being used | ||
* Any modifications you've made relevant to the bug | ||
* Anything unusual about your environment or deployment | ||
|
||
Ideally, you can install autogluon.assistant and its dependencies in a fresh virtualenv to reproduce the bug. | ||
|
||
## Contributing via Pull Requests | ||
Code contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: | ||
|
||
1. You are working against the latest source on the *main* branch. | ||
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. | ||
3. You open an issue to discuss any significant work - we would hate for your time to be wasted. | ||
|
||
To send us a pull request, please: | ||
|
||
1. Fork the repository. | ||
2. Modify the source (see details below); please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. | ||
3. Ensure local tests pass. | ||
4. Commit to your fork using clear commit messages. | ||
5. Send us a pull request, answering any default questions in the pull request interface. | ||
6. Notify the maintainer to review your PR so that they can tag your PR as `safe to test` and start the CI process. | ||
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. | ||
|
||
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and | ||
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). | ||
|
||
|
||
## Tips for Modifying the Source Code | ||
|
||
- Using a fresh virtualenv, install the package via `pip3 install -e .`. | ||
|
||
- Use Python versions consistent with what the package supports as defined in `setup.py` (3.8 - 3.11). | ||
|
||
- All code should adhere to the [PEP8 style](https://www.python.org/dev/peps/pep-0008/). | ||
|
||
- After you have edited the code, ensure your changes pass the unit tests via: | ||
``` | ||
pytest tests/ | ||
``` | ||
|
||
- We encourage you to add your own unit tests, but please ensure they run quickly (unit tests involving cloud resources generally would take a long time). You can run a specific unit test within a specific file like this: | ||
``` | ||
python3 -m pytest path_to_file::test_mytest | ||
``` | ||
Or remove the ::test_mytest suffix to run all tests in the file: | ||
``` | ||
python3 -m pytest path_to_file | ||
``` | ||
|
||
- After you open your pull request, our CI system will **NOT** run by default if you don't have write permission to our repo as our CI involves usage of AWS resources. Please ping the maintainer so that they can tag your PR and trigger the CI runs for you. Please check back and fix any errors encountered at this stage (you will need to repeat this process for each new commit you push). | ||
|
||
|
||
## Finding Contributions to Work On | ||
Looking at the existing issues is a great way to find something to contribute on. As our project uses the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/autogluon/autogluon-assistant/labels/help%20wanted) issues is a great place to start. | ||
|
||
|
||
## Code of Conduct | ||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). | ||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact | ||
[email protected] with any additional questions or comments. | ||
|
||
|
||
## Security Issue Notifications | ||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. | ||
|
||
|
||
## Licensing | ||
|
||
See the [LICENSE](https://github.com/autogluon/autogluon-assistant/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. | ||
|
||
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ML Assistant for Competitive Machine Learning | ||
Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.