-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transfer first version from DSS repo
- Loading branch information
1 parent
de808d1
commit 45dd43f
Showing
9 changed files
with
558 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/.github/workflows/pub.yml | ||
# To create a release, see https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository | ||
|
||
name: publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.x" | ||
architecture: "x64" | ||
- name: install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: build sdist(tarball) and bdist(wheel) to dist/ | ||
run: >- # = python -m build . works the same way by default | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
- name: publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/.github/workflows/test.yml | ||
|
||
name: package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
install-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.8", "3.9"] | ||
max-parallel: 3 | ||
name: Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: "x64" | ||
- name: confirm pip version | ||
run: pip --version | ||
- name: installation | ||
run: pip install .[dev] | ||
- name: test | ||
run: python -m pytest --cov | ||
editable-install-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.8"] | ||
max-parallel: 3 | ||
name: Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: "x64" | ||
- name: confirm pip version | ||
run: pip --version | ||
- name: installation | ||
run: pip install -e .[dev] | ||
- name: test | ||
run: python -m pytest --cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/.github/workflows/testpub.yml | ||
|
||
name: publish-test | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.x" | ||
architecture: "x64" | ||
- name: install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: build sdist(tarball) and bdist(wheel) to dist/ | ||
run: >- # = python -m build . works the same way by default | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
- name: publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Contributions to this repository are managed via the same process as for the [dss repository](https://github.com/interuss/dss/CONTRIBUTING.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
# implicitdict | ||
|
||
This library primarily provides the `ImplicitDict` base class which enables the inheriting class to implicitly be treated like a `dict` with entries corresponding to the fields of the inheriting class. Simple example: | ||
|
||
```python | ||
class MyData(ImplicitDict): | ||
foo: str | ||
bar: int = 0 | ||
baz: Optional[float] | ||
|
||
data: MyData = ImplicitDict.parse({'foo': 'asdf', 'bar': 1}, MyData) | ||
assert json.dumps(data) == '{"foo": "asdf", "bar": 1}' | ||
``` | ||
|
||
See [class documentation for `ImplicitDict`](src/implicitdict/__init__.py) and [test_normal_usage.py](tests/test_normal_usage.py) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/pyproject.toml | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools>=64", | ||
"wheel", # for bdist package distribution | ||
"setuptools_scm>=6.4", # for automated versioning | ||
] | ||
|
||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
package-dir = { "" = "src" } | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
namespaces = true | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/implicitdict/_version.py" | ||
|
||
[project] | ||
name = "implicitdict" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name="InterUSS Platform", email="[email protected]" }, | ||
] | ||
description = "ImplicitDict base class that turns a subclass into a dict indexing attributes, making [de]serialization easy for complex typing-annotated data types." | ||
readme = "README.md" | ||
license = { file = "LICENSE.md" } | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = ["arrow", "pytimeparse"] | ||
[project.optional-dependencies] | ||
dev = ["pytest==5.0.0", "pytest-cov[all]", "black==21.10b0"] | ||
[project.urls] | ||
"Homepage" = "https://github.com/interuss/implicitdict" | ||
"Bug Tracker" = "https://github.com/interuss/implicitdict/issues" | ||
|
||
[tool.black] | ||
target-version = ['py39'] | ||
line-length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
arrow==1.2.3 | ||
pytimeparse==1.1.8 |
Oops, something went wrong.