-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Initial command line --version
- Loading branch information
Showing
16 changed files
with
409 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[run] | ||
source = yhttp | ||
omit = | ||
|
||
[report] | ||
exclude_lines = | ||
raise NotImplementedError | ||
pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[flake8] | ||
ignore = W503, F811 | ||
exclude = | ||
per-file-ignores = | ||
yhttp/markdown/__init__.py: F401 | ||
tests/conftest.py: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ 'v*' ] | ||
|
||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
name: Pytest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
env: | ||
PREFIX: /usr | ||
FLAKE8: flake8 | ||
PYTEST: pytest | ||
COVERAGE: coverage | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
sudo git clone https://github.com/pylover/python-makelib.git /usr/local/lib/python-makelib | ||
make install-common editable-install | ||
sudo cp `which bddcli-bootstrapper` /usr/local/bin | ||
- name: Lint | ||
run: make lint | ||
- name: Test | ||
run: make cover | ||
- name: Coveralls | ||
run: coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
coveralls-finish: | ||
name: Coveralls finish | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: Install dependencies | ||
run: python -m pip install coveralls | ||
- name: Coveralls Finished | ||
run: coveralls --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
|
||
release: | ||
name: Github Release | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Deploy | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploypypi: | ||
name: Deploy to PyPI | ||
runs-on: ubuntu-latest | ||
env: | ||
PREFIX: /usr | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: Install dependencies | ||
run: | | ||
sudo git clone https://github.com/pylover/python-makelib.git /usr/local/lib/python-makelib | ||
make install-common editable-install | ||
- name: Create distributions | ||
run: make dist | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.9 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
PKG_NAMESPACE = yhttp.markdown | ||
PKG_NAME = yhttp-markdown | ||
PYTEST_FLAGS = -vv | ||
PYDEPS_COMMON = \ | ||
'bddrest >= 5.1, < 6' \ | ||
'bddcli >= 2.5.1, < 3' \ | ||
'yhttp-dev >= 3.1.3' | ||
|
||
|
||
# Assert the python-makelib version | ||
PYTHON_MAKELIB_VERSION_REQUIRED = 1.5.4 | ||
|
||
|
||
# Ensure the python-makelib is installed | ||
PYTHON_MAKELIB_PATH = /usr/local/lib/python-makelib | ||
ifeq ("", "$(wildcard $(PYTHON_MAKELIB_PATH))") | ||
MAKELIB_URL = https://github.com/pylover/python-makelib | ||
$(error python-makelib is not installed. see "$(MAKELIB_URL)") | ||
endif | ||
|
||
|
||
# Include a proper bundle rule file. | ||
include $(PYTHON_MAKELIB_PATH)/venv-lint-test-webapi.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- pretty fallback page | ||
- github actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/usr/local/lib/python-makelib/activate.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import os.path | ||
import re | ||
|
||
from setuptools import setup, find_namespace_packages | ||
|
||
|
||
# Reading package's version (same way sqlalchemy does) | ||
with open( | ||
os.path.join(os.path.dirname(__file__), 'yhttp/markdown', '__init__.py') | ||
) as v_file: | ||
package_version = \ | ||
re.compile('.*__version__ = \'(.*?)\'', re.S)\ | ||
.match(v_file.read())\ | ||
.group(1) | ||
|
||
|
||
dependencies = [ | ||
'yhttp >= 5.3, < 6', | ||
'pymlconf', | ||
'easycli' | ||
] | ||
|
||
|
||
setup( | ||
name='yhttp-markdown', | ||
version=package_version, | ||
author='Vahid Mardani', | ||
url='https://github.com/yhttp/markdown', | ||
description='Markdown to HTML coverter and server with yhttp.', | ||
long_description=open('README.md').read(), | ||
long_description_content_type='text/markdown', # This is important! | ||
license='APLv1', | ||
install_requires=dependencies, | ||
dependency_links=[ | ||
], | ||
packages=find_namespace_packages( | ||
where='.', | ||
include=['yhttp.markdown'], | ||
exclude=['tests'] | ||
), | ||
entry_points={ | ||
'console_scripts': [ | ||
'yhttp-markdown = yhttp.markdown.main:Main.quickstart' | ||
] | ||
}, | ||
classifiers=[ | ||
'Environment :: Console', | ||
'Environment :: Web Environment', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'Development Status :: 5 - Production/Stable', | ||
'License :: Other/Proprietary License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python :: 3.6', | ||
'Topic :: Software Development', | ||
'Topic :: Internet :: WWW/HTTP', | ||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', | ||
'Topic :: Software Development :: Libraries', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
] | ||
) |
Oops, something went wrong.