Skip to content

Commit

Permalink
chore: update pipeline and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
mrf345 committed Jul 2, 2024
1 parent 00d6b02 commit 003dbbe
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 29 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build
on:
push:
schedule:
# runs a new build everyday
- cron: 0 0 * * *

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.18.1'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/requirements/test.txt'
- name: Install dependencies
run: pip install -r requirements/test.txt
- name: Style check
run: |
python -m flake8
- name: Tests
run: |
python -m pytest
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Generate Coverage Badge

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: pip install -r requirements/test.txt
- name: Set coverage percentage
run: |
echo "COVERAGE=$(pytest | awk '$1 == "TOTAL" {print $NF+0}')%" >> $GITHUB_ENV
REF=${{ github.ref }}
IFS='/' read -ra PATHS <<< "$REF"
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
- name: Generate coverage badge
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: bc746d7bfe356b54fbb93b2ea5d0d2a4
filename: flask_datepicker__${{ env.BRANCH }}.json
label: coverage
message: ${{ env.COVERAGE }}
color: green
namedLogo: pytest
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<h1 align='center'> Flask-Datepicker </h1>
<p align='center'>
<a href='https://travis-ci.com/mrf345/flask_datepicker'>
<img src='https://travis-ci.com/mrf345/flask_datepicker.svg?branch=master' />
</a>
<a href='https://github.com/mrf345/flask_datepicker/releases'>
<a href='https://pypi.org/project/Flask-Datepicker/'>
<img src='https://img.shields.io/github/v/tag/mrf345/flask_datepicker' alt='Latest Release' />
</a><br/>
<a href='https://coveralls.io/github/mrf345/flask_datepicker?branch=master'>
<img src='https://coveralls.io/repos/github/mrf345/flask_datepicker/badge.svg?branch=master' alt='Coverage Status' />
</a>
<a href='https://www.python.org/dev/peps/pep-0008/'>
<img src='https://img.shields.io/badge/code%20style-PEP8-orange.svg' alt='Code Style' />
</a>
<a href='https://pypi.org/project/Flask-Datepicker/'>
<img src='https://img.shields.io/pypi/dm/flask_datepicker' alt='Number of downloads' />
</a>
</a>
<a href='https://github.com/mrf345/flask_datepicker/actions/workflows/ci.yml'>
<img src='https://github.com/mrf345/flask_datepicker/actions/workflows/ci.yml/badge.svg'>
</a>
<a href='https://github.com/mrf345/flask_datepicker/actions/workflows/ci.yml'>
<img src='https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/mrf345/bc746d7bfe356b54fbb93b2ea5d0d2a4/raw/flask_datepicker__heads_master.json' alt='Coverage Percentage' />
</a>
<br />
<img src='https://img.shields.io/pypi/pyversions/flask_datepicker' alt='Supported versions' />
<br />
</p>

<h3 align='center'>A Flask extension for jQueryUI DatePicker, it makes adding and customizing multiple date pickers simpler and less time consuming.</h3>

## Install:
Expand Down
1 change: 0 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pytest
pytest-runner
pytest-cov
coverage
python-coveralls
flake8
31 changes: 17 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from setuptools import setup


supported_versions = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
basedir = path.abspath(path.dirname(__file__))
long_description = ''
requirements = []
test_requirements = []
requirements_path = path.join(basedir, 'requirements')


Expand All @@ -15,14 +15,21 @@
with open(path.join(basedir, 'README.md')) as f:
long_description += f.read()

with open(path.join(requirements_path, 'main.txt')) as f:
requirements += [line for line in f.read().split('\n') if line]
test_requirements += requirements
if path.isdir(requirements_path):
with open(path.join(requirements_path, 'main.txt')) as f:
requirements += [line for line in f.read().split('\n') if line]
else:
requires_path = path.join(
path.join(basedir, "Flask_Datepicker.egg-info"), "requires.txt"
)

with open(path.join(requirements_path, 'test.txt')) as f:
test_requirements += [
line for line in f.read().split('\n')
if line and not line.startswith('-r')]
with open(requires_path) as f:
requirements += [line for line in f.read().split("\n") if line]


supported_python_classifiers = [
"Programming Language :: Python :: {0}".format(v) for v in supported_versions
]


setup(
Expand All @@ -42,14 +49,10 @@
include_package_data=True,
platforms='any',
install_requires=requirements,
setup_requires=test_requirements,
setup_requires=requirements,
keywords=['flask', 'extension', 'date', 'picker', 'jquery-ui', 'datepicker'],
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
*supported_python_classifiers,
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
Expand Down

0 comments on commit 003dbbe

Please sign in to comment.