Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 78cf1c3f authored by freezed's avatar freezed :mountain:
Browse files

:twisted_rightwards_arrows: Merge branch '10-add-pydocstyle'

Resolve "Add pydocstyle"

Closes #10

See merge request fcode/geostrapy!4
parents e2562cd9 acf4d5ec
No related branches found
No related tags found
1 merge request!4Resolve "Add pydocstyle"
Pipeline #4307 passed
......@@ -24,4 +24,5 @@ clean: # Remove files not tracked in source control
lint: # Lint code
${VIRTUAL_ENV}/bin/black --check --quiet cli/*.py
${VIRTUAL_ENV}/bin/flake8 --config=setup.cfg
${VIRTUAL_ENV}/bin/pydocstyle
${VIRTUAL_ENV}/bin/pylint --rcfile=setup.cfg cli/*.py
......@@ -43,9 +43,9 @@ python cli/run.py --help
🚧 Development
--------------
- [Topic branches](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows#_topic_branch) are used and named after issue's slug
- Follow our [`git` conventions](https://forga.gitlab.io/process/fr/manuel/convention/git/) (🇫🇷 only)
- Built with `Python 3.9`
- Code linting with [`flake8`](https://pypi.org/project/flake8/), [`pylint`](https://pypi.org/project/pylint) & [`black`](https://pypi.org/project/black)
- Code linting with [`flake8`](https://pypi.org/project/flake8/), [`pylint`](https://pypi.org/project/pylint), [`black`](https://pypi.org/project/black) & [pydocstyle](https://pypi.org/project/pydocstyle/).
- Install development tools:
* `pip install -r requirements-dev.txt`
- A `Makefile` with tools : run `make help` to have a look
......
"""
API utilities
"""
#!/usr/bin/env python3
# coding:utf-8
"""Strava's API helpers."""
from strava.api._helpers import client, url, json
def post_activity(xargs):
"""API call to create an activity"""
"""Post an activity creation.
Activity creation is made only with parameters (no GPX file).
"""
response = client.post(url=url("/activities"), data=xargs)
if response.ok:
......
"""
CLI commands
#!/usr/bin/env python3
# coding:utf-8
"""Manage CLI commands.
Each function describes a CLI command.
"""
import datetime
......@@ -83,7 +86,7 @@ _ACTIVITY_COLUMNS = ("key", "value")
@output_option()
@login_required
def post_create(**kwargs):
"""Create an activity"""
"""Create an activity (manually)."""
xargs = {
"name": kwargs["name"],
"type": kwargs["activity_type"],
......
#!/usr/bin/env python3
# coding:utf-8
"""
run.py: CLI launcher, just run it
"""Geostrapy CLI.
Add `geostrapy` commands to `strava-cli`
Share data related to physical activities over an API (geo-localized or not)
This module adds commands for `strava-cli` https://github.com/bwilczynski/strava-cli
"""
import click
from strava.commands import (
......@@ -20,10 +18,7 @@ from commands import post_create
@click.group()
def cli():
"""
Share data related to physical activities over an API (geo-localized or not)
Add commands for `strava-cli` https://github.com/bwilczynski/strava-cli
"""
"""Launch the CLI."""
cli.add_command(login)
......
black
flake8
pydocstyle
pylint
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment