Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Initial code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Apr 4, 2023
1 parent cc3b3ae commit 0a0b9c0
Show file tree
Hide file tree
Showing 36 changed files with 758 additions and 1 deletion.
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
131 changes: 131 additions & 0 deletions .github/workflows/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
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: Install dependencies
run: make install
- name: Prepare environment
run: cp .env.example .env
- name: Test software
run: make test-ci
- 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.8
- name: Install dependencies
# 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 install
- name: Prepare environment
run: cp .env.example .env
- name: Test software
run: 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.8
- name: Install dependencies
run: make install
- name: Prepare environment
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.8
- name: Install and build site
run: |
echo '!**/*.html' >> .gitignore
make install
livemark build
- 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.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build distribution
run: |
python setup.py sdist bdist_wheel
- 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 }}
24 changes: 24 additions & 0 deletions .github/workflows/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: project

on:
issues:
types:
- opened
- reopened
pull_request:
types:
- opened
- reopened

jobs:
project-assign:
runs-on: ubuntu-latest
steps:
- name: Assign to project
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ secrets.PROJECT_TOKEN }}
resource_node_id: ${{ github.event_name == 'issues' && github.event.issue.node_id || github.event.pull_request.node_id }}
organization: frictionlessdata
project_id: 16
status_value: Inbox
96 changes: 96 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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/
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standards.frictionlessdata.io
1 change: 1 addition & 0 deletions LEAD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
roll
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 © `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.
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
recursive-include standards *
include LICENSE.md
include Makefile
include pylama.ini
include pytest.ini
include README.md
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.PHONY: all coverage docker-setup docs install format github lint release test test-ci


PACKAGE := $(shell grep '^PACKAGE =' setup.py | cut -d '"' -f2)
VERSION := $(shell head -n 1 $(PACKAGE)/assets/VERSION)
LEAD := $(shell head -n 1 LEAD.md)


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

coverage:
sensible-browser coverage/index.html

docs:
livemark build

format:
black $(PACKAGE) tests

install:
pip install --upgrade -e .[dev]

lint:
black $(PACKAGE) tests --check
pylama $(PACKAGE) tests
pyright $(PACKAGE) tests

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:
make lint
pytest --cov ${PACKAGE} --cov-report term-missing --cov-report html:coverage --cov-fail-under 70 --timeout=300

test-ci:
make lint
pytest --cov ${PACKAGE} --cov-report term-missing --cov-report xml --cov-fail-under 80 --timeout=300 --ci
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# standards
# Standards

[![Build](https://img.shields.io/github/actions/workflow/status/frictionlessdata/standards/general.yaml?branch=main)](https://github.com/frictionlessdata/standards/actions)
[![Coverage](https://img.shields.io/codecov/c/github/frictionlessdata/standards/main)](https://codecov.io/gh/frictionlessdata/standards)
[![Codebase](https://img.shields.io/badge/codebase-github-brightgreen)](https://github.com/frictionlessdata/standards)
[![Support](https://img.shields.io/badge/support-slack-brightgreen)](https://join.slack.com/t/frictionlessdata/shared_invite/zt-17kpbffnm-tRfDW_wJgOw8tJVLvZTrBg)
Loading

0 comments on commit 0a0b9c0

Please sign in to comment.