Skip to content

Commit

Permalink
Merge pull request #30 from speg03/update/project-restarting
Browse files Browse the repository at this point in the history
Update project settings to other project methods
  • Loading branch information
speg03 committed Nov 12, 2023
2 parents 3016d83 + c1244cc commit ab30911
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 262 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
versioning-strategy: lockfile-only

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
6 changes: 0 additions & 6 deletions .github/release-drafter.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/release.yml
@@ -0,0 +1,20 @@
changelog:
categories:
- title: New Features
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Breaking Changes
labels:
- breaking change
- title: Update Dependencies
labels:
- dependencies
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"
89 changes: 69 additions & 20 deletions .github/workflows/python-tests.yml
Expand Up @@ -2,31 +2,80 @@ name: Python Tests

on:
push:
branches:
- master
branches: [main]
pull_request:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip

- name: Install dependencies
run: python3 -m pip install build

- name: Build
run: make dist

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: packages
path: ./dist
retention-days: 1

test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages
path: ./dist

- name: Install dependencies
run: python3 -m pip install "$(find ./dist -name '*-py3-none-any.whl' | tail -1)[test]"

- name: Test
run: make test

- name: Upload coverage reports
uses: codecov/codecov-action@v3

publish:
needs: test
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
environment:
name: release
url: https://pypi.org/project/${{ github.event.repository.name }}/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.1.1

- name: Install dependencies
run: poetry install

- name: Test with pytest
run: poetry run pytest -v ./tests

- name: Upload coverage reports
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages
path: ./dist

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
14 changes: 0 additions & 14 deletions .github/workflows/release-drafter.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/upload-python-package.yml

This file was deleted.

28 changes: 25 additions & 3 deletions .gitignore
Expand Up @@ -95,9 +95,21 @@ ipython_config.py
#Pipfile.lock

# poetry
poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -139,3 +151,13 @@ dmypy.json

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Package version file is generated automatically
src/nestargs/_version.py
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
- id: ruff-format
args: [--diff]

ci:
autoupdate_schedule: quarterly
18 changes: 18 additions & 0 deletions Makefile
@@ -0,0 +1,18 @@
.PHONY: all
all: dist

.PHONY: clean
clean:
rm -rf ./dist

.PHONY: lint
lint:
pre-commit run --all-files

.PHONY: test
test:
pytest -v ./tests

.PHONY: dist
dist:
python3 -m build

0 comments on commit ab30911

Please sign in to comment.