Skip to content

Commit

Permalink
start adding md files, docs, tests, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
NodeJSmith committed Jun 12, 2024
1 parent e654e2e commit 3caca8b
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 8 deletions.
9 changes: 9 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Credits

## Development Lead

* Jessica Smith <j.smith.git1@gmail.com>

## Contributors

None yet. Why not be the first?
119 changes: 119 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

## Types of Contributions

### Report Bugs

Report bugs at https://github.com/nodejsmith/otf/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

### Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

### Implement Features

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

### Write Documentation

otf could always use more documentation, whether as part of the
official otf docs, in docstrings, or even on the web in blog posts,
articles, and such.

### Submit Feedback

The best way to send feedback is to file an issue at https://github.com/nodejsmith/otf/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

## Get Started!

Ready to contribute? Here's how to set up `otf` for local development.

1. Fork the `otf` repo on GitHub.
2. Clone your fork locally

```
$ git clone git@github.com:your_name_here/otf.git
```

3. Ensure [poetry](https://python-poetry.org/docs/) is installed.
4. Install dependencies and start your virtualenv:

```
$ poetry install -E test -E doc -E dev
```

5. Create a branch for local development:

```
$ git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally.

6. When you're done making changes, check that your changes pass the
tests, including testing other Python versions, with tox:

```
$ tox
```

7. Commit your changes and push your branch to GitHub:

```
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
```

8. Submit a pull request through the GitHub website.

## Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
3. The pull request should work for Python 3.6, 3.7, 3.8, 3.9 and for PyPy. Check
https://github.com/nodejsmith/otf/actions
and make sure that the tests pass for all supported Python versions.

## Tips```
$ pytest tests.test_otf
```To run a subset of tests.
## Deploying
A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.md).
Then run:
```
$ poetry patch # possible: major / minor / patch
$ git push
$ git push --tags
```
Github Actions will then deploy to PyPI if tests pass.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# History

## 0.0.1 (2024-06-12)

* First release on PyPI.
2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) [2024] [Jessica Smith]
Copyright (c) 2024, Jessica Smith

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
85 changes: 85 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
site_name: otf
repo_url: https://github.com/nodejsmith/otf
repo_name: otf
#strict: true
nav:
- home: index.md
- installation: installation.md
- usage: usage.md
- contributing: contributing.md
- authors: authors.md
- history: history.md
- Code Reference: reference/
theme:
name: material
language: en
#logo: assets/logo.png
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-night
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-sunny
name: Switch to light mode
features:
- navigation.tabs
- navigation.instant
- navigation.tabs.sticky
- navigation.sections
- navigation.expansion
markdown_extensions:
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.critic
- pymdownx.caret
- pymdownx.mark
- pymdownx.tilde
- pymdownx.tabbed
- attr_list
- pymdownx.arithmatex:
generic: true
- pymdownx.highlight:
linenums: true
- pymdownx.superfences
- pymdownx.details
- admonition
- toc:
baselevel: 2
permalink: true
slugify: !!python/object/apply:pymdownx.slugs.slugify {}
- meta
plugins:
- include-markdown
- search:
lang: en
- gen-files:
scripts:
- scripts/gen_ref_pages.py
- literate-nav:
nav_file: SUMMARY.md
- section-index
- mkdocstrings:
default_handler: python
handlers:
python:
options:
extensions:
- griffe_fieldz: { include_inherited: true }
show_source: true
preload:
- pydantic

extra:
version:
provider: mike
social:
- icon: fontawesome/brands/github
link: https://github.com/nodejsmith/otf
name: Github
- icon: material/email
link: "mailto:j.smith.git1@gmail.com"
30 changes: 30 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[mypy]
# Ensure we know what we do
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true

# Imports management
ignore_missing_imports = false

# Ensure full coverage
disallow_untyped_defs = true
#disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
# Restrict dynamic typing (a little)
# e.g. `x: List[Any]` or x: List`
disallow_any_generics = true

# Show errors codes
show_error_codes = true

# From functions not declared to return Any
warn_return_any = true

[mypy-fire]
ignore_missing_imports = true


[mypy-pycognito.*]
ignore_missing_imports = True
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "otf-api"
version = "0.0.1"
description = "Python OrangeTheory Fitness API Client"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.8"


classifiers = [
Expand Down Expand Up @@ -41,7 +41,22 @@ dev = [
"pytest-asyncio==0.23.7",
"aioresponses==0.7.6",
"tox==4.15.1",
"pytest-cov==5.0.0",
"build==1.2.1",
"ruff==0.4.8",
]
docs = [
"mkdocs==1.6.0",
"mkdocs-include-markdown-plugin",
"mkdocs-material",
"mkdocstrings",
"mkdocs-material-extensions",
"mkdocs-autorefs",
"mike",
"setuptools",
"pkginfo",
"virtualenv",
"mkdocstrings[python]==0.25.1",
]

[tools.pytest.ini_options]
pythonpath = ["src"]
35 changes: 30 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
[tox]
skipsdist=True
envlist = py310, py311
skipsdist = true
isolated_build = true
envlist = py310, py311, lint

[gh-actions]
python =
3.11: py311
3.10: py310

[testenv:lint]
extras =
dev
doc
deps =
.[dev,doc]
commands =
ruff format src
ruff check src
mypy -m src --exclude ^tests
python -m build
mkdocs build
twine check dist/*

[testenv]
allowlist_externals = ruff,mypy
recreate = False
deps =
passenv = *
setenv =
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = ignore
deps =
.[dev]
commands =
pytest
commands =
pytest

0 comments on commit 3caca8b

Please sign in to comment.