Skip to content

Commit 132b748

Browse files
authored
[TOOLSLIBS-2187] Lib Release 7.0 Prep (#213)
* updates build configs * requirements and precommit updates * more precommit updates * more precommit updates * furter config updates * flake8 black etc * fix circular import * readme updates * build settings updates * github workflow updates * updates changelog * remove badge * use dev reqs * rm flake8
1 parent bce38f9 commit 132b748

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+378
-259
lines changed

.codespell-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
caf
2+
optins

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
The Contributor License Agreement (CLA) below is to ensure that when someone contributes code to one of our open source libraries that we have a clear record of the license to use it. This is necessary so that we can ensure to all of our customers that they can make use of our libraries and tools without worry. You retain copyright of all of your code.
66

7-
Please read through the agreement at the URL below.
7+
Please read through the agreement at the URL below.
88

99
If you have questions about this agreement or why we need it please contact us at https://support.airship.com/.
1010

11-
[Contribution Agreement](https://docs.google.com/forms/d/e/1FAIpQLScErfiz-fXSPpVZ9r8Di2Tr2xDFxt5MgzUel0__9vqUgvko7Q/viewform)
11+
[Contribution Agreement](https://docs.google.com/forms/d/e/1FAIpQLScErfiz-fXSPpVZ9r8Di2Tr2xDFxt5MgzUel0__9vqUgvko7Q/viewform)

.github/ISSUE_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ You are welcome to submit an issue here for bugs, but please also reach out to o
44

55
Before completing the form below, please check the following:
66

7-
- [ ] You are using the most recent version of the library.
8-
- [ ] You are using a supported version of Python for that library version.
9-
- [ ] This issue is reproducible.
7+
- [ ] You are using the most recent version of the library.
8+
- [ ] You are using a supported version of Python for that library version.
9+
- [ ] This issue is reproducible.
1010

1111
## Expected Behavior
1212
<!--- Tell us what should happen -->
@@ -30,4 +30,4 @@ Before completing the form below, please check the following:
3030

3131
## Possible Fix
3232
<!--- Not required, but suggest your possible solution if possible. -->
33-
<!-- If your fix is known to work, we accept pull requests with a completed contribution agreement. -->
33+
<!-- If your fix is known to work, we accept pull requests with a completed contribution agreement. -->

.github/SUPPORT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Support Requests
22

3-
All requests for support including implementation support and feature requests are made to the Airship support team.
3+
All requests for support including implementation support and feature requests are made to the Airship support team.
44

55
You can contact them by visiting https://support.airship.com/
66

77
# Documentation
88

99
Documentation for the library can be found here:
10-
https://docs.airship.com/api/libraries/python/
10+
https://docs.airship.com/api/libraries/python/

.github/workflows/docs_release.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@ on:
77
description: Library Version
88
required: true
99
default: x.x.x
10+
type: string
1011

1112
jobs:
1213
build:
13-
1414
runs-on: ubuntu-latest
15-
1615
permissions:
1716
contents: 'read'
1817
id-token: 'write'
1918

2019
steps:
21-
- uses: actions/checkout@master
22-
- name: Set up Python 3.9
23-
uses: actions/setup-python@v1
20+
- uses: actions/checkout@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
2423
with:
25-
python-version: 3.9
26-
- name: Setup Gcloud SDK
27-
uses: google-github-actions/setup-gcloud@v0
24+
python-version: "3.13"
25+
- name: Setup Google Cloud SDK
26+
uses: google-github-actions/setup-gcloud@v2
2827
with:
29-
version: '340.0.0' # This version isn't special, just setting it to make builds stable
30-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
28+
project_id: ${{ secrets.GCP_PROJECT_ID }}
3129
service_account_key: ${{ secrets.GCP_SA_KEY }}
3230
- name: Install dependencies
3331
run: |
3432
python -m pip install --upgrade pip
35-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33+
python -m pip install .[dev]
34+
python -m pip install -r docs/requirements.txt
3635
- name: Build & Zip Sphinx HTML Docs
3736
run: |
3837
cd docs/
3938
make clean html
4039
cd _build/html
4140
tar -czvf ../../${{ github.event.inputs.libVersion }}.tar.gz .
42-
- id: "gcs-upload"
43-
uses: 'google-github-actions/upload-cloud-storage@v0'
41+
- name: Upload to Google Cloud Storage
42+
uses: 'google-github-actions/upload-cloud-storage@v2'
4443
with:
4544
path: 'docs/${{ github.event.inputs.libVersion }}.tar.gz'
4645
destination: 'ua-web-ci-prod-docs-transfer/libraries/python/${{ github.event.inputs.libVersion }}.tar.gz'
46+
parent: false
Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
name: Pypi Test Build and Upload
1+
name: PyPI Test Build and Upload
22

33
on:
44
release:
55
types: [created]
66

77
jobs:
88
build:
9-
109
runs-on: ubuntu-latest
11-
10+
permissions:
11+
id-token: write
1212
steps:
13-
- uses: actions/checkout@master
14-
- name: Set up Python 3.9 for build
15-
uses: actions/setup-python@v1
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
1616
with:
17-
python-version: 3.9
18-
19-
- name: Install pypa/build
20-
run: >-
21-
python -m
22-
pip install
23-
build
24-
--user
17+
python-version: "3.13"
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
python -m pip install build twine
2522
- name: Build binary wheel and source tarball
26-
run: >-
27-
python -m
28-
build
29-
--sdist
30-
--wheel
31-
--outdir dist/
32-
- name: Publish to test Pypi
23+
run: |
24+
python -m build
25+
twine check dist/*
26+
- name: Publish to Test PyPI
3327
if: ${{github.repository == 'urbanairship/python-library-dev'}}
34-
uses: pypa/gh-action-pypi-publish@release/v1
28+
uses: pypa/gh-action-pypi-publish@v1
3529
with:
3630
password: ${{ secrets.PYPI_TEST_TOKEN }}
37-
repository_url: https://test.pypi.org/legacy/
31+
repository-url: https://test.pypi.org/legacy/

.github/workflows/release_build_push.yaml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,24 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
1012
steps:
11-
- uses: actions/checkout@master
12-
- name: Set up Python 3.9 for build
13-
uses: actions/setup-python@v1
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
1416
with:
15-
python-version: 3.13
16-
17-
- name: Install pypa/build
18-
run: >-
19-
python -m
20-
pip install
21-
build
22-
--user
17+
python-version: "3.13"
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
python -m pip install build twine
2322
- name: Build binary wheel and source tarball
24-
run: >-
25-
python -m
26-
build
27-
--sdist
28-
--wheel
29-
--outdir dist/
30-
- name: Publish to Pypi
23+
run: |
24+
python -m build
25+
twine check dist/*
26+
- name: Publish to PyPI
3127
if: ${{github.repository == 'urbanairship/python-library-dev'}}
32-
uses: pypa/gh-action-pypi-publish@release/v1
28+
uses: pypa/gh-action-pypi-publish@v1
3329
with:
3430
password: ${{ secrets.PYPI_TOKEN_URBANAIRSHIP }}

.github/workflows/test_runner.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ on: [push]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
strategy:
99
matrix:
1010
python-version: ["3.10", "3.11", "3.12", "3.13"]
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: ${{ matrix.python-version }}
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install flake8 pytest
22-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
23-
- name: Run mypy checks
21+
python -m pip install -r requirements-dev.txt
22+
- name: Type check with mypy
2423
run: |
2524
mypy urbanairship/
26-
- name: Test with unittest
25+
- name: Test with pytest
2726
run: |
28-
python -m unittest
29-
- name: Build Sphinx Docs
27+
python -m pytest
28+
- name: Build package
3029
run: |
31-
cd docs/
32-
make clean html
30+
python -m pip install build twine
31+
python -m build
32+
twine check dist/*

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ nosetests.xml
1515
.noseids
1616
/mypython
1717
ipynb/
18-
18+
.coverage
19+
.mypy_cache/
1920
# Ignoring venv stuff
2021
bin/
2122
lib/
2223
man/
23-
pyvenv.cfg
24+
pyvenv.cfg

.pre-commit-config.yaml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,53 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- id: no-commit-to-branch
99
args: ["--branch", "master", "--branch", "main"]
10+
- id: check-added-large-files
11+
- id: check-json
12+
- id: check-toml
1013
- repo: https://github.com/psf/black
11-
rev: 24.4.0
14+
rev: 24.2.0
1215
hooks:
1316
- id: black
17+
language_version: python3.13
18+
- repo: https://github.com/pycqa/isort
19+
rev: 6.0.1
20+
hooks:
21+
- id: isort
22+
- repo: https://github.com/pycqa/flake8
23+
rev: 7.0.0
24+
hooks:
25+
- id: flake8
26+
additional_dependencies: [flake8-bugbear>=24.2.6]
27+
args: [
28+
"--max-line-length=99",
29+
"--extend-ignore=E203,W503,E501,C901", # Ignore style errors that conflict with Black, line length, and complexity
30+
"--exclude=.git,__pycache__,build,dist",
31+
"--per-file-ignores=*/__init__.py:F401"
32+
]
1433
- repo: https://github.com/codespell-project/codespell
1534
rev: v2.2.6
1635
hooks:
17-
- id: codespell
18-
- repo: https://github.com/pre-commit/mirrors-mypy
19-
rev: v1.9.0
20-
hooks:
21-
- id: mypy
22-
additional_dependencies: [types-requests, types-six, types-urllib3, types-mock]
36+
- id: codespell
37+
args: [--ignore-words=.codespell-ignore]
38+
exclude: >
39+
(?x)^(
40+
.*\.lock|
41+
\.git/.*|
42+
.*/build/.*
43+
)$
44+
- repo: https://github.com/pre-commit/mirrors-mypy
45+
rev: v1.9.0
46+
hooks:
47+
- id: mypy
48+
additional_dependencies:
49+
- types-requests>=2.31.0.20240311
50+
- types-six>=1.16.21.20240311
51+
- types-mock>=5.1.0.20240311
52+
- types-urllib3
53+
exclude: ^(docs/|tests/)

0 commit comments

Comments
 (0)