Skip to content

Commit

Permalink
Merge pull request #5 from kozalosev/upd-deps
Browse files Browse the repository at this point in the history
Update dependencies, build and CI configs
  • Loading branch information
kozalosev committed Feb 12, 2023
2 parents 48ef204 + 42efe98 commit c091d67
Show file tree
Hide file tree
Showing 19 changed files with 353 additions and 2,436 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI Build
on:
push:
branches:
- '**'
jobs:
Run-tests:
strategy:
matrix:
version: [ '3.8', '3.9', '3.10', '3.11' ]
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."

- name: Install poetry
run: pipx install poetry

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
cache: 'poetry'

- name: Install dependencies
run: make install

- run: echo "🖥️ The workflow is now ready to test your code on the runner."

- name: Test code
run: make test

- name: Test build
run: make build && make build-docs

- run: echo "🍏 This job's status is ${{ job.status }}."
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to PyPI
on:
push:
tags:
- 'v*'
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."

- name: Install poetry
run: pipx install poetry && poetry self add "poetry-dynamic-versioning[plugin]"

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'poetry'

- run: echo "🖥️ The workflow is now ready to build and deploy your distribution."

- name: Build a distribution
run: make build

- name: Install the built distribution locally and check its version
run: >
[ ! -f dist/klocmod-0.0.0-py3-none-any.whl ] &&
pip install dist/klocmod-*-py3-none-any.whl &&
python -c "import klocmod; exit(0 if klocmod.__version__ != '0.0.0' else -1)"
- name: Publish the distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- run: echo "🍏 This job's status is ${{ job.status }}."
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export POETRY = $(HOME)/.local/bin/poetry

install:
curl -sSL https://install.python-poetry.org | python3 - && \
$(POETRY) self add "poetry-dynamic-versioning[plugin]" && \
$(POETRY) install --all-extras && \
$(POETRY) run pip install -r docs/requirements.txt
test:
$(POETRY) run pytest
build:
$(POETRY) build
build-docs:
$(POETRY) add sphinx && $(POETRY) run sphinx-build docs build/sphinx
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ klocmod -- Kozalo's Localization Module

*Screw you, gettext! I don't wanna bother of compiling strings into binary files!*

[![Build Status](https://travis-ci.org/kozalosev/klocmod.svg?branch=master)](https://travis-ci.org/kozalosev/klocmod)
[![Build Status](https://github.com/kozalosev/klocmod/actions/workflows/ci-build.yml/badge.svg)](https://github.com/kozalosev/klocmod/actions/workflows/ci-build.yml)
[![Documentation Status](https://readthedocs.org/projects/klocmod/badge/?version=latest)](https://klocmod.readthedocs.io/en/latest/?badge=latest)

This module provides a very simple, suboptimal way for localizing your scripts, bots or applications. The advantage is
Expand Down
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

import dunamai as _dunamai

# -- Project information -----------------------------------------------------

project = 'klocmod'
copyright = 'Kozalo.Ru, 2018'
copyright = 'Kozalo.Blog, 2018-2023'
author = 'Leonid Kozarin'

# The short X.Y version
version = ''
version = _dunamai.get_version(project, third_choice=_dunamai.Version.from_git).serialize()
# The full version, including alpha/beta/rc tags
release = ''

Expand Down Expand Up @@ -42,7 +43,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx_rtd_theme==1.2.0
dunamai==1.15.0
4 changes: 1 addition & 3 deletions klocmod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@
from pathlib import PurePath, Path

from .internals import swap_keys, check_missing_non_regional_languages
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

__version__ = "0.0.0"
__all__ = ['LanguageDictionary', 'SpecificLanguageDictionary', 'LocalizationsContainer', 'InvalidLocalizationFileError']
_logger = logging.getLogger(__name__)

Expand Down

0 comments on commit c091d67

Please sign in to comment.