Skip to content

Commit

Permalink
tox: initial tox setup
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDanielThangarajan committed Jan 6, 2024
1 parent 6aa8be4 commit 816ec7a
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 3 deletions.
Empty file.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
max-line-length=180

[MASTER]
ignore-paths=src/nasdaq_protocols/_version.py
disable=
C0114, #missing-module-docstring
C0115, #missing-class-docstring
Expand Down
1 change: 1 addition & 0 deletions LICENSE → docs/LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MIT License
===========

Copyright (c) 2024 Nasdaq

Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
# https://www.sphinx-doc.org/en/master/usage/theming.html [themes]
html_theme = 'agogo'
html_static_path = ['_static']
31 changes: 31 additions & 0 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Developer's Guide
=================

This guide is intended for developers who want to contribute to the
development of the `nasdaq-protocols` library.


Guidelines
----------
Before merging to main, please ensure that the following guidelines are met:

- All existing tests are passing.
- New tests are added when needed.
- Pylint reports no errors, 10/10
- Code is documented and docstrings are added when needed.
- Documentation is included in the rst files.


Building
________
.. code-block:: console
$ tox r
`tox r` will execute all of the following.

- `tox -e lint` - Runs linter and validates the code
- `tox -e test` - Runs the pytest test cases
- `tox -e build` - Builds the package sdist and wheel
- `tox -e doc` - Builds the documentation

2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Welcome to nasdaq-protocols's documentation!
install
api_reference
user_guide
developer_guide
LICENSE


Indices and tables
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ classifiers = [
'Topic :: Software Development :: Libraries :: Python Modules'
]

dynamic = ["version", "dependencies"]
dependencies = [
'attrs>=23.1'
]

dynamic = ["version"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
version = {attr = "nasdaq_protocols/_version.version"}

[tool.setuptools_scm]
Expand Down
37 changes: 37 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tox]
requires =
tox>4
virtualenv>20.2
env_list =
lint
test
build
doc

[testenv:lint]
description = Run pylint
deps = pylint
commands = pylint --fail-under=10.0 "--ignore-patterns=.*egg-info.*,.*test.*" src/*


[testenv:test]
description = Run pytest
deps =
pytest
pytest-asyncio
pytest-sugar
commands = pytest


[testenv:build]
description = Build package
deps = build
commands = python -m build


[testenv:doc]
description = Build documenation
deps = sphinx
commands = make html
change_dir = docs
allowlist_externals = make

0 comments on commit 816ec7a

Please sign in to comment.