Skip to content

Commit

Permalink
feat: initial version for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Apr 7, 2023
1 parent c05984a commit b2ad434
Show file tree
Hide file tree
Showing 91 changed files with 3,390 additions and 1,169 deletions.
19 changes: 19 additions & 0 deletions .copier-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes here will be overwritten by Copier; do NOT edit manually
_commit: v0.1.9
_src_path: gh:entelecheia/hyperfast-python-template
author: Young Joon Lee
copyright_year: 2023
documentaion_tool: mkdocs
documentation_url: https://ekonlpy.entelecheia.ai
email: entelecheia@hotmail.com
friendly_name: eKoNLPy
github_repo_name: eKoNLPy
github_username: entelecheia
package_name: ekonlpy
project_description: This is a Korean natural language processing toolkit for economic
analysis. It is based on Mecab and Mecab-ko-dic.
project_license: MIT
project_name: eKoNLPy
project_short_description: A Korean natural language processing toolkit for economic
analysis

24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Check http://editorconfig.org for more information

# top-most .editorconfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space

[*.py]
profile = black

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
27 changes: 27 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "03:00"
timezone: "Asia/Seoul"
labels:
- ":game_die: dependencies"
- ":robot: bot"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "03:00"
timezone: "Asia/Seoul"
allow:
- dependency-type: "production"
labels:
- ":game_die: dependencies"
- ":robot: bot"
66 changes: 66 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: bfd4f2
- name: bug
description: Something isn't working
color: d73a4a
- name: build
description: Build System and Dependencies
color: bfdadc
- name: ci
description: Continuous Integration
color: 4a97d6
- name: dependencies
description: Pull requests that update a dependency file
color: 0366d6
- name: documentation
description: Improvements or additions to documentation
color: 0075ca
- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
- name: enhancement
description: New feature or request
color: a2eeef
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: 7057ff
- name: help wanted
description: Extra attention is needed
color: 008672
- name: invalid
description: This doesn't seem right
color: e4e669
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: 2b67c6
- name: question
description: Further information is requested
color: d876e3
- name: refactoring
description: Refactoring
color: ef67c4
- name: removal
description: Removals and Deprecations
color: 9ae7ea
- name: style
description: Style
color: c120e5
- name: testing
description: Testing
color: b1fc6f
- name: wontfix
description: This will not be worked on
color: ffffff
20 changes: 20 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: Breaking Changes 🛠
labels:
- breaking
- title: Exciting New Features 🎉
labels:
- feature
- title: Fixes 🔧
labels:
- fix
- title: Other Changes
labels:
- "*"
36 changes: 36 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: deploy-docs
on:
workflow_call:
workflow_dispatch:
push:
branches:
- main
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory
paths:
- "README.md"
- "mkdocs.yaml"
- "docs/**.md"
- "docs/images/**"
- ".github/workflows/deploy-docs.yaml"

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.x

- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: |
pip install -r docs/requirements.txt
mkdocs gh-deploy --force
79 changes: 79 additions & 0 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: lint & test

on:
workflow_call:
workflow_dispatch:
# push:
# branches:
# - "*"
# paths:
# - "src/**"
# - "tests/**"

jobs:
build:
# Name the Job
name: test-code-base
# Set the agent to run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
# Checkout the code base #
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

# install poetry
- name: Install poetry
run: pipx install poetry>=1.3.2

# set up python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

# install dependencies
- name: Install dependencies for linters
run: make install-dev

# run linters
- name: Run linters
run: |
set -o pipefail
make lint
# run unit tests
- name: Run unit-tests
run: |
set -o pipefail
make scm-version
make tests-cov-fail
# add content to GitHub summary
- name: Pytest coverage GitHub summary
run: |
set -o pipefail
echo '# Coverage report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat pytest-coverage.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '\n\n\n'
echo '${{ steps.coverageComment.outputs.coverageHtml }}' >> $GITHUB_STEP_SUMMARY
# add pytest coverage report to PR
- name: Pytest coverage comment
if: ${{ success() && github.event_name == 'pull_request' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
title: Coverage Report
pytest-coverage-path: pytest-coverage.txt
junitxml-path: pytest.xml
46 changes: 46 additions & 0 deletions .github/workflows/prerelease-to-test-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: semantic-prerelease

on:
workflow_call:
workflow_dispatch:

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
# Name the Job
name: prerelease
# Set the agent to run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

# Load all steps #
steps:
# Checkout the code base #
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

# set env variable
- name: Set env variable
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV

# semantic release
- name: Python Semantic Release to Test PyPI
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.TEST_PYPI_API_TOKEN }}
additional_options: --prerelease --verbosity=DEBUG --define=branch=${{ env.BRANCH }}
env:
REPOSITORY_URL: https://test.pypi.org/legacy/

50 changes: 50 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: semantic-prerelease

on:
workflow_call:
workflow_dispatch:
push:
branches:
- pre*
- beta*
- alpha*
- rc*
- nigtly*

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
# Name the Job
name: prerelease
# Set the agent to run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

# Load all steps #
steps:
# Checkout the code base #
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

# set env variable
- name: Set env variable
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV

# semantic release
- name: Python Semantic Release to PyPI
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_API_TOKEN }}
additional_options: --prerelease --verbosity=DEBUG --define=branch=${{ env.BRANCH }}
Loading

0 comments on commit b2ad434

Please sign in to comment.