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 ...@@ -24,4 +24,5 @@ clean: # Remove files not tracked in source control
lint: # Lint code lint: # Lint code
${VIRTUAL_ENV}/bin/black --check --quiet cli/*.py ${VIRTUAL_ENV}/bin/black --check --quiet cli/*.py
${VIRTUAL_ENV}/bin/flake8 --config=setup.cfg ${VIRTUAL_ENV}/bin/flake8 --config=setup.cfg
${VIRTUAL_ENV}/bin/pydocstyle
${VIRTUAL_ENV}/bin/pylint --rcfile=setup.cfg cli/*.py ${VIRTUAL_ENV}/bin/pylint --rcfile=setup.cfg cli/*.py
...@@ -43,9 +43,9 @@ python cli/run.py --help ...@@ -43,9 +43,9 @@ python cli/run.py --help
🚧 Development 🚧 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` - 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: - Install development tools:
* `pip install -r requirements-dev.txt` * `pip install -r requirements-dev.txt`
- A `Makefile` with tools : run `make help` to have a look - A `Makefile` with tools : run `make help` to have a look
......
""" #!/usr/bin/env python3
API utilities # coding:utf-8
""" """Strava's API helpers."""
from strava.api._helpers import client, url, json from strava.api._helpers import client, url, json
def post_activity(xargs): 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) response = client.post(url=url("/activities"), data=xargs)
if response.ok: if response.ok:
......
""" #!/usr/bin/env python3
CLI commands # coding:utf-8
"""Manage CLI commands.
Each function describes a CLI command.
""" """
import datetime import datetime
...@@ -83,7 +86,7 @@ _ACTIVITY_COLUMNS = ("key", "value") ...@@ -83,7 +86,7 @@ _ACTIVITY_COLUMNS = ("key", "value")
@output_option() @output_option()
@login_required @login_required
def post_create(**kwargs): def post_create(**kwargs):
"""Create an activity""" """Create an activity (manually)."""
xargs = { xargs = {
"name": kwargs["name"], "name": kwargs["name"],
"type": kwargs["activity_type"], "type": kwargs["activity_type"],
......
#!/usr/bin/env python3 #!/usr/bin/env python3
# coding:utf-8 # coding:utf-8
""" """Geostrapy CLI.
run.py: CLI launcher, just run it
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 import click
from strava.commands import ( from strava.commands import (
...@@ -20,10 +18,7 @@ from commands import post_create ...@@ -20,10 +18,7 @@ from commands import post_create
@click.group() @click.group()
def cli(): def cli():
""" """Launch the 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
"""
cli.add_command(login) cli.add_command(login)
......
black black
flake8 flake8
pydocstyle
pylint 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