Skip to content

Commit

Permalink
Setup CI etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Sep 9, 2024
2 parents ec0d0c8 + 1d8447e commit f050608
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
22 changes: 22 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
merge_group:
push:
branches:
- 'main'
tags: [ 'v*' ]
pull_request:
branches:
- 'main'

permissions: {}

jobs:
lint:
name: Linter
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
path: requirements.txt
- name: Mypy
run: mypy
- name: Install itself
run: |
pip install .
- name: Prepare twine checker
run: |
pip install -U build twine wheel
python -m build
- name: Run twine checker
run: twine check dist/*

deploy:
name: Deploy
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
needs: [lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run:
python -m pip install -U pip wheel setuptools build twine
- name: Build dists
run: |
python -m build
- name: PyPI upload
uses: pypa/gh-action-pypi-publish@release/v1
- name: GitHub Release
uses: ncipollo/release-action@v1
with:
name: junction-sdk
artifacts: dist/*
token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BSD 2-Clause License

Copyright (c) 2024, Snowfall Limited

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Junction SDK

An SDK for the Junction API.
2 changes: 2 additions & 0 deletions junction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from junction.client import JunctionClient as JunctionClient
from junction.typedefs import Passenger as Passenger

__version__ = "0.1"
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[build-system]
requires = ["setuptools>=46"]
build-backend = "setuptools.build_meta"

[project]
name = "otds"
dependencies = ["aiohttp>=3.10,<4", "aiojobs>=1.3,<2"]
description = "SDK for Junction"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Development Status :: 2 - Pre-Alpha"
]

[project.urls]
Homepage = "https://github.com/snowfall-travel/python-junction"
Issues = "https://github.com/snowfall-travel/python-junction/issues"

[tool.setuptools]
packages = ["junction"]

[tool.setuptools.dynamic]
version = {attr = "junction.__version__"}
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
aiohttp==3.10.5
aiojobs==1.3.0
mypy==1.11.2

0 comments on commit f050608

Please sign in to comment.