Skip to content

Commit

Permalink
feat: start improving project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Apr 10, 2022
1 parent 22b11ba commit 5949476
Show file tree
Hide file tree
Showing 11 changed files with 1,268 additions and 342 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
49 changes: 38 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,54 @@ name: CI

on:
push:
tags: ["v*"]
branches: [main]
pull_request:
branches: [main]

jobs:
publish:
name: Publish
main:
name: Test and release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Setup poetry cache
id: cached-poetry
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ runner.os }}
- name: Install poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
- name: Setup venv cache
id: cached-venv
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
if: steps.cached-venv.outputs.cache-hit != 'true'
run: poetry install
- name: Check formatting
run: poetry run black --check pynbs
- name: Release
if: |
github.repository == 'OpenNBS/pynbs'
&& github.event_name == 'push'
&& github.ref == 'refs/heads/main'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <[email protected]>" --prerelease
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"bungcip.better-toml"
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"python.linting.enabled": false,
"python.linting.pylintEnabled": false,
"python.linting.banditEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.mypyEnabled": false,
"python.linting.prospectorEnabled": false,
"python.linting.pycodestyleEnabled": false,
"python.linting.pydocstyleEnabled": false,
"python.linting.pylamaEnabled": false,
"[python]": {
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
Loading

0 comments on commit 5949476

Please sign in to comment.