Skip to content

Commit

Permalink
Bootstrapped package
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Sep 7, 2023
1 parent 3f7d35c commit 39fc1e9
Show file tree
Hide file tree
Showing 15 changed files with 606 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
comment: no
coverage:
range: 80..90
status:
project:
default:
informational: true
patch:
default:
informational: true
3 changes: 3 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Overview

Please replace this line with full information about your idea or problem. If it's a bug share as much as possible to reproduce it
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- fixes #<issue-number>

---

Please make sure that all the checks pass. Please add here any additional information regarding this pull request. It's highly recommended that you link this PR to an issue (please create one if it doesn't exist for this PR)
23 changes: 23 additions & 0 deletions .github/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30

# Issues with these labels will never be considered stale
exemptLabels:
- feature
- enhancement
- bug

# Label to use when marking an issue as stale
staleLabel: wontfix

# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
129 changes: 129 additions & 0 deletions .github/workflows/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: general

on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
schedule:
- cron: "0 3 * * *"

jobs:

# Test (Linux)

test-linux:
if: github.event_name != 'schedule' || github.repository_owner == 'frictionlessdata'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Prepare environment
run: pip3 install hatch
- name: Prepare variables
run: cp .env.example .env
- name: Test software
run: hatch run ci:test +py=${{ matrix.py || matrix.python-version }}
- name: Report coverage
uses: codecov/codecov-action@v2

# Test (MacOS)

test-macos:
if: github.event_name != 'schedule' || github.repository_owner == 'frictionlessdata'
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Prepare environment
run: pip3 install hatch
- name: Prepare variables
run: cp .env.example .env
- name: Test software
# https://stackoverflow.com/questions/9678408/cant-install-psycopg2-with-pip-in-virtualenv-on-mac-os-x-10-7
run: LDFLAGS=`echo $(pg_config --ldflags)` make test

# Test (Windows)

test-windows:
if: github.event_name != 'schedule' || github.repository_owner == 'frictionlessdata'
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Prepare environment
run: pip3 install hatch
- name: Prepare variables
run: cp .env.example .env
- name: Test software
run: make test

# Deploy

deploy:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Prepare environment
run: pip3 install hatch
- name: Install and build site
run: |
echo '!**/*.html' >> .gitignore
make docs
- name: Publush to Github Pages
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: site
create_branch: true
push_options: '--force'

# Release

release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [test-linux, test-macos, test-windows]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: pip install -U build
- name: Build distribution
run: python -m build
- name: Publish to PYPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_KEY }}
- name: Release to GitHub
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 changes: 97 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
.python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

pip-wheel-metadata/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask instance folder
instance/

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# dotenv
.env

# Spyder project settings
.spyderproject

# Livemark
/blog/**/*.html
/docs/**/*.html
/index.html
/404.html

# Extras
.frictionless/
.google.json
coverage/
.vscode/
.server/
site/
tmp/
.vim
3 changes: 3 additions & 0 deletions .nvim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": ".python/dpspecs/bin/python"
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Open Knowledge Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.PHONY: all coverage docker-setup docs install format github lint release test test-ci write


PACKAGE := $(shell grep '^name =' pyproject.toml | cut -d '"' -f2)
VERSION := $(shell grep '^VERSION =' ${PACKAGE}/settings.py | cut -d '"' -f2)


all:
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'

coverage:
hatch run coverage

docker:
docker build --rm -t frictionless-dev .

docs:
hatch run docs

format:
hatch run format

lint:
hatch run lint

release:
git checkout main && git pull origin && git fetch -p
@git log --pretty=format:"%C(yellow)%h%Creset %s%Cgreen%d" --reverse -20
@echo "\nReleasing v$(VERSION) in 10 seconds. Press <CTRL+C> to abort\n" && sleep 10
make test && git commit -a -m 'v$(VERSION)' && git tag -a v$(VERSION) -m 'v$(VERSION)'
git push --follow-tags

test:
hatch run test

version:
@echo $(VERSION)

write:
hatch run write
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dpspecs-py

Empty file added dpspecs/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions dpspecs/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Version

VERSION = "5.15.10"
Loading

0 comments on commit 39fc1e9

Please sign in to comment.