Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Rejuvenate #27

Merged
merged 11 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[flake8]

## Define error messages to be ignored.
ignore =
## We want double hash to be allowed for comments.
E266

## Defines files and directories to be excluded from checking.
exclude =
*.egg-info,
*.py[codi],
.cache,
.eggs,
.git,
.mypy_cache,
.tox,
__pycache__,
build,
dev,
dist,
result,
tmp

## Defines maximum MCCABE complexity allowed.
max-complexity = 7

## Defines the maximum line length.
max-line-length = 120

## Indicates that doctests to be run.
doctests = True

## Indicates that we want summary statistics of error messages, if any.
statistics = True
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Release"

on:
push:
branches:
- "main"

permissions:
contents: "write"
pull-requests: "write"

jobs:
release-please:
runs-on: "ubuntu-latest"

steps:
- name: "Release"
uses: "googleapis/release-please-action@v4"

35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
pull_request:

jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
python:
- "3.10"
- "3.11"
- "3.12"

steps:
- name: "Checkout codebase"
uses: "actions/checkout@v4"
- name: "Setup Python"
uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python }}"
- name: "Install Package with Test Dependencies"
run: "pip install -e \".[test]\""
- name: "Run Tests: isort"
run: "isort --diff --check decaf/"
- name: "Run Tests: black"
run: "black --check decaf/"
- name: "Run Tests: mypy"
run: "mypy --namespace-packages --package decaf.api.client"
- name: "Run Tests: flake8"
run: "flake8"
- name: "Run Tests: pytest"
run: "pytest --verbose --doctest-modules"
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/pip-wheel-metadata
/tmp/
__pycache__
/result
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.11"
}
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,38 @@

### 0.0.4 (2019-07-31)

* 2019-07-31 a143018 Add put method to the client ([email protected])
* 2019-05-30 764faa8 Create client from profile ([email protected])
* 2019-05-18 5f52572 (chore) Bump version to 0.0.4.dev0 ([email protected])

### 0.0.3 (2019-05-18)

* 2019-05-18 90e269d Merge branch '0.0.3' ([email protected])
* 2019-05-18 9eaf384 (fix) Fix README.md and setup.py ([email protected])
* 2019-05-18 bd7b714 (fix) Fix packaging ([email protected])
* 2019-05-18 79e7758 (release) Update change log ([email protected])
* 2019-05-18 2d88cb1 (release) Bump version to 0.0.3 ([email protected])
* 2019-05-18 6176470 (chore) Adapt setup to README.md ([email protected])
* 2019-05-18 0e4ad31 (chore) Convert README from .rst to .md ([email protected])
* 2019-05-18 b3e58f9 (chore) Upgrade requests dependency ([email protected])
* 2019-05-18 643cb5f (chore) Rename package to decaf.api.client ([email protected])
* 2019-04-16 bb66fda (chore) Version bumped to 0.0.3.dev0 ([email protected])

### 0.0.2 (2019-04-16)

* 2019-04-16 1984637 Merge branch '0.0.2' ([email protected])
* 2019-04-16 747dd8c (release) Change log updated ([email protected])
* 2019-04-16 d3cdc74 (release) Version bumped to 0.0.2 ([email protected])
* 2019-03-07 23be6ea (improve) Support for remote value collections ([email protected])
* 2019-03-07 77c19bc (fix) Entity endpoint attribute fix ([email protected])
* 2019-03-06 d13ba17 (improve) Request timeouts and exception handling ([email protected])
* 2019-03-05 779002b (chore) Revisit dev dependencies ([email protected])
* 2019-03-05 e590bd8 (chore) Version bumped to 0.0.2.dev0 ([email protected])

### 0.0.1 (2019-03-05)

* 2019-03-05 3b3ebcb Merge branch '0.0.1' ([email protected])
* 2019-03-05 d663296 (release) Change log updated ([email protected])
* 2019-03-05 b4a0bdc (release) Version bumped to 0.0.1 ([email protected])
* 2019-03-05 afd8b3b Initial code commit ([email protected])
* 2019-03-05 a90b4dc Initial commit ([email protected])
37 changes: 0 additions & 37 deletions ChangeLog.old

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (2017-2019) Vehbi Sinan Tunalioglu.
Copyright (2019-2023) Teloscube Pte Ltd.
Copyright (2019-2024) Teloscube Pte Ltd.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DECAF API Client (Python)

[![Github](https://github.com/telostat/decaf-api-client-python/workflows/Install%20and%20Test/badge.svg)](https://github.com/telostat/decaf-api-client-python/actions)
[![Test](https://github.com/teloscube/decaf-client-python/actions/workflows/test.yml/badge.svg)](https://github.com/teloscube/decaf-client-python/actions/workflows/test.yml)

> **TODO:** Provide a complete README file.

Expand All @@ -9,35 +9,21 @@
A Nix shell is provided for development:

```sh
nix-shell
nix develop
```

Run tests:
Build to run tests:

```sh
tox
```

Open the codebase in Visual Studio Code:

```sh
code .
```

Alternatively, you can issue following commands directly without entering the
Nix shell:

```sh
nix-shell --arg python "\"python39\"" --run tox
nix-shell --arg python "\"python310\"" --run tox
nix build
```

## Build and Publish

Build the source distribution:

```sh
python setup.py sdist bdist_wheel
python -m build --sdist --wheel
```

Check the distribution(s):
Expand All @@ -54,5 +40,8 @@ twine upload -s dist/*

## License and Copyrights

This software is licensed under [The 3-Clause BSD
License](https://opensource.org/licenses/BSD-3-Clause).
This software is licensed under [The 3-Clause BSD License].

<!-- REFERENCES -->

[The 3-Clause BSD License]: https://opensource.org/licenses/BSD-3-Clause
2 changes: 1 addition & 1 deletion decaf/api/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#: Defines the name of the :mod:`decaf.api.client` package.
__version__ = "0.0.12.dev0"
__version__ = "0.0.12.dev0" # x-release-please-version
4 changes: 1 addition & 3 deletions decaf/api/client/endpoints/stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import datetime
from decimal import Decimal
from enum import Enum
from typing import List, Optional

from typing_extensions import Literal
from typing import List, Literal, Optional

from ..machinery import BaseResource, ResourceEndpoint, query
from ..types import GUID, AccountId, ArtifactId, ArtifactTypeId, InstitutionId, PortfolioId, TeamId
Expand Down
2 changes: 1 addition & 1 deletion decaf/api/client/machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
Generic,
Iterable,
List,
Literal,
Optional,
Set,
TextIO,
Expand All @@ -69,7 +70,6 @@
import requests
from pydantic import BaseModel, Field
from requests.auth import AuthBase
from typing_extensions import Literal


@dataclass(frozen=True)
Expand Down
4 changes: 1 addition & 3 deletions decaf/api/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

from decimal import Decimal
from itertools import groupby
from typing import Callable, Dict, Iterable, Optional, Tuple, TypeVar, Union

from typing_extensions import Protocol
from typing import Callable, Dict, Iterable, Optional, Protocol, Tuple, TypeVar, Union

from .types import Date, DateTime

Expand Down
Loading