Skip to content

Commit

Permalink
Initial structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Avanov committed Dec 27, 2020
0 parents commit dc0a5d9
Show file tree
Hide file tree
Showing 27 changed files with 1,247 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [avanov]
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "CI"
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
tests:
strategy:
matrix:
python-version: [ 38 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- uses: cachix/install-nix-action@v12
with:
install_url: https://releases.nixos.org/nix/nix-2.3.10/install
extra_nix_config: "system-features = benchmark kvm"
- name: Run tests on Python${{ matrix.python-version }}
run: |
nix-shell --argstr pyVersion ${{ matrix.python-version }} --run \
"pip install -e . && pip install -r requirements/test.txt && pip install -r requirements/extras/third_party.txt && make test"
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
nix-shell --argstr pyVersion ${{ matrix.python-version }} --arg isDevEnv false --run "coveralls"
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.[oa]
*~
.py[co]
__pycache__/
.doit.db
.idea/
.cache/
.pytest_cache/
.DS_Store

.venv*/
.local/
build/
dist/
*.egg-info/

docs/_build

*nose*
*node_modules*
# Ignore all test-related files (see setup.py -> setup(tests_require=[]))
*coverage*
# but keep the .coveragerc (for TravisCI/Coveralls services)
!.coveragerc

# Ignore vagrant box meta files
.vagrant/
*-console.log

# Compass/Sass cache
.sass-cache/

# compiled pacific configs
*.pconf

# do not track contents of private directories
*_priv/

# ansible temporary files
deploy/*.retry
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "specification"]
path = specification
url = https://github.com/OAI/OpenAPI-Specification.git
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=========
CHANGELOG
=========

0.0.1
=====

* Initial Release
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Maxim Avanov

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.
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.python.org/3/distutils/sourcedist.html#manifest
include README.rst CHANGES LICENSE
recursive-include requirements *.txt
recursive-include openapi_type
recursive-include openapi_type py.typed
exclude requirements/test.txt
prune tests
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://www.gnu.org/software/make/manual/html_node/Special-Variables.html
# https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_17.html
PROJECT_MKFILE_PATH := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
PROJECT_MKFILE_DIR := $(shell cd $(shell dirname $(PROJECT_MKFILE_PATH)); pwd)

PROJECT_NAME := openapi_type
PROJECT_ROOT := $(PROJECT_MKFILE_DIR)

BUILD_DIR := $(PROJECT_ROOT)/build
DIST_DIR := $(PROJECT_ROOT)/dist

PROJECT=openapi_type

test: typecheck
pytest -s --cov=openapi_type $(PROJECT_ROOT)/tests

typecheck:
mypy --config-file setup.cfg --package $(PROJECT_NAME)

publish: test
rm -rf $(BUILD_DIR) $(DIST_DIR)
python $(PROJECT_ROOT)/setup.py sdist bdist_wheel
twine upload $(DIST_DIR)/*
63 changes: 63 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. _badges:

.. image:: https://github.com/avanov/openapi-type/workflows/CI/badge.svg?branch=develop
:target: https://github.com/avanov/openapi-type/actions?query=branch%3Adevelop

.. image:: https://coveralls.io/repos/github/avanov/openapi-type/badge.svg?branch=develop
:target: https://coveralls.io/github/avanov/openapi-type?branch=develop

.. image:: https://requires.io/github/avanov/openapi-type/requirements.svg?branch=master
:target: https://requires.io/github/avanov/openapi-type/requirements/?branch=master
:alt: Requirements Status

.. image:: https://readthedocs.org/projects/openapi-type/badge/?version=latest
:target: https://openapi-type.readthedocs.io/en/latest/
:alt: Documentation Status

.. image:: http://img.shields.io/pypi/v/openapi-type.svg
:target: https://pypi.python.org/pypi/openapi-type
:alt: Latest PyPI Release


OpenAPI Type
============

OpenAPI specification represented as a Python type. Use it to parse specifications written in JSON and YAML formats.

Cloning this repo
-----------------

The proper way to clone this repo is:

.. code-block:: bash
git clone --recurse-submodules <repo-url> <local-project-root>
cd <local-project-root>
# for showing submodule status with `git status`
git config status.submodulesummary 1
# for logging submodule diff with `git diff`
git config diff.submodule log
Documentation
-------------

Documentation is hosted on ReadTheDocs: https://openapi-type.readthedocs.io/en/develop/


Test framework
--------------

Run existing test suite with

.. code::
$ nix-shell --run "make test"
Changelog
---------

See `CHANGELOG <https://github.com/avanov/openapi-type/blob/master/CHANGELOG.rst>`_.

0 comments on commit dc0a5d9

Please sign in to comment.