Skip to content

Commit

Permalink
Add CONTRIBUTING.md and misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joowani committed Feb 8, 2021
1 parent c9a7279 commit 681b9c4
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 78 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ repos:
rev: v0.790
hooks:
- id: mypy
args: [ --ignore-missing-imports ]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

Set up dev environment:
```shell
cd ~/your/repository/fork # Activate venv if you have one (recommended)
pip install -e .[dev] # Install dev dependencies (e.g. black, mypy, pre-commit)
pre-commit install # Install git pre-commit hooks
```

Run unit tests with coverage:

```shell
py.test --cov=./ --cov-report=html # Open htmlcov/index.html in your browser
```

Build and test documentation:

```shell
python -m sphinx docs docs/_build # Open docs/_build/index.html in your browser
```

Thank you for your contribution!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016,2017,2018,2019,2020,2021 Joohwan Oh
Copyright (c) 2016-2021 Joohwan Oh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include README.md LICENSE
prune tests
recursive-include gifs
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,3 @@ print(root.values)
```

Check out the [documentation](http://binarytree.readthedocs.io) for more details.

Contributing
============

Set up dev environment:

```shell
cd ~/your/binarytree/clone # Activate venv if you have one (recommended)
pip install -e .[dev] # Install dev dependencies (black, mypy, pre-commit etc.)
pre-commit install # Install git pre-commit hooks
```

Run unit tests with coverage:

```shell
py.test --cov=binarytree --cov-report=html
```
51 changes: 1 addition & 50 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,60 +1,11 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath(".."))

import binarytree

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

project = "binarytree"
copyright = "2016,2017,2018,2019,2020,2021, Joohwan Oh"
copyright = "2016-2021, Joohwan Oh"
author = "Joohwan Oh"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.viewcode",
]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version = binarytree.__version__
release = binarytree.__version__

# The master toctree document.
master_doc = "index"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

htmlhelp_basename = "binarytreedoc"
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools_scm[toml]>=3.4",
"wheel",
"setuptools_scm[toml]>=3.4"
]
build-backend = "setuptools.build_meta"

[tool.coverage.run]
omit = ["binarytree/version.py"]
omit = [
"binarytree/version.py",
"setup.py"
]

[tool.isort]
profile = "black"
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
author="Joohwan Oh",
author_email="[email protected]",
url="https://github.com/joowani/binarytree",
keywords=["tree", "heap", "bst", "education"],
packages=find_packages(exclude=["tests"]),
include_package_data=True,
python_requires=">=3.6",
Expand All @@ -25,10 +26,10 @@
extras_require={
"dev": [
"black",
"flake8",
"flake8>=3.8.4",
"isort>=5.0.0",
"mypy",
"pre-commit",
"mypy>=0.790",
"pre-commit>=2.9.3",
"pytest>=6.0.0",
"pytest-cov>=2.0.0",
"sphinx",
Expand All @@ -38,12 +39,12 @@
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Operating System :: Unix",
"Programming Language :: Python :: 3",
"Topic :: Documentation :: Sphinx",
"Topic :: Education",
],
)

0 comments on commit 681b9c4

Please sign in to comment.