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

Merge sources into one repo #329

Merged
merged 42 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d28b49d
WIP: consistent abstractions project.
andrueastman Sep 8, 2024
5b0ed83
add authentication project
andrueastman Sep 9, 2024
424c151
add http package
andrueastman Sep 9, 2024
dd3472c
add json serialization package
andrueastman Sep 9, 2024
0dc8a32
add form serialization
andrueastman Sep 9, 2024
34efc40
add multipart package
andrueastman Sep 9, 2024
260342a
add text serialization library
andrueastman Sep 9, 2024
68d8ca9
test workflows
andrueastman Sep 9, 2024
2bc6a18
use path
andrueastman Sep 9, 2024
db2dd38
remove lock files
andrueastman Sep 9, 2024
17acde0
align configs
andrueastman Sep 9, 2024
0203e83
more validations
andrueastman Sep 9, 2024
fe9acfc
fix typo
andrueastman Sep 9, 2024
f1124eb
todo validate missing imports
andrueastman Sep 9, 2024
a928f96
fix typo
andrueastman Sep 9, 2024
5782dce
fixing failing multipart lib
andrueastman Sep 9, 2024
74af29b
add missing dev dependency
andrueastman Sep 9, 2024
eb817e7
use relative path project imports
andrueastman Sep 9, 2024
7ec7701
setup publishing workflow
andrueastman Sep 9, 2024
08bc61b
Merge main into feature/kiota-python
andrueastman Sep 10, 2024
1f879d7
Merge main into feature/kiota-python
andrueastman Sep 11, 2024
2227122
resolve typing errors in the project
andrueastman Sep 13, 2024
ede3732
format code
andrueastman Sep 13, 2024
d371499
Merge main into feature/kiota-python
andrueastman Sep 23, 2024
b02c779
Merge branch 'feature/kiota-python' into andrueastman/resolvetypinger…
andrueastman Sep 23, 2024
6465520
adds validation with generated project
andrueastman Sep 23, 2024
a6f130d
Merge pull request #340 from microsoft/andrueastman/addgenerationVali…
andrueastman Sep 23, 2024
6e0e396
pr review feedback
andrueastman Sep 25, 2024
6842de0
feat: setup release please.
andrueastman Oct 7, 2024
da8e453
Merge pull request #331 from microsoft/andrueastman/resolvetypingerrors
andrueastman Oct 8, 2024
33b779d
chore: formating for very long lines
andrueastman Oct 8, 2024
5411d15
Merge pull request #344 from microsoft/andrueastman/resolveVersioning
andrueastman Oct 8, 2024
ddab7a4
chore: run formatting tool for the repo
andrueastman Oct 8, 2024
fad4205
sync sources.
andrueastman Oct 8, 2024
ec48153
Merge pull request #345 from microsoft/andrueastman/syncSources
baywet Oct 8, 2024
90c5510
chore: cleanup readme
andrueastman Oct 9, 2024
93ce2b0
add common validation check
andrueastman Oct 9, 2024
412d8b9
Merge branch 'main' into feature/kiota-python
andrueastman Oct 14, 2024
505c5b9
sync sources for https://github.com/microsoft/kiota-http-python/pull/434
andrueastman Oct 14, 2024
8a41b73
Merge pull request #351 from microsoft/andrueastman/syncSources
andrueastman Oct 14, 2024
0461225
Merge remote-tracking branch 'origin/main' into feature/kiota-python
andrueastman Oct 14, 2024
6da0197
resolve missed typing issue.
andrueastman Oct 14, 2024
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
44 changes: 33 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,33 @@ on:
push:
branches: [main]
pull_request:
branches: [main, dev]
branches: [main]
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
max-parallel: 5
max-parallel: 10
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
library :
- name: "kiota_abstractions"
path: "./packages/abstractions"
- name: "kiota_authentication_azure"
path: "./packages/authentication/azure"
- name: "kiota_http"
path: "./packages/http/httpx"
- name: "kiota_serialization_form"
path: "./packages/serialization/form"
- name: "kiota_serialization_json"
path: "./packages/serialization/json"
- name: "kiota_serialization_text"
path: "./packages/serialization/text"
- name: "kiota_serialization_multipart"
path: "./packages/serialization/multipart"

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -27,21 +43,27 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: ${{ matrix.library.path }}
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m pip install --upgrade poetry
poetry install
- name: Check code format
working-directory: ${{ matrix.library.path }}
run: |
yapf -dr kiota_abstractions
poetry run yapf -dr ${{ matrix.library.name }}
- name: Check import order
working-directory: ${{ matrix.library.path }}
run: |
isort kiota_abstractions
poetry run isort ${{ matrix.library.name }}
- name: Lint with Pylint
working-directory: ${{ matrix.library.path }}
run: |
pylint kiota_abstractions --disable=W --rcfile=.pylintrc
- name: Static type checking with Mypy
run: |
mypy kiota_abstractions
poetry run pylint ${{ matrix.library.name }} --disable=W --rcfile=.pylintrc
# - name: Static type checking with Mypy
# working-directory: ${{ matrix.library.path }}
# run: |
# poetry run mypy ${{ matrix.library.name }} --ignore-missing-imports
- name: Run the tests
working-directory: ${{ matrix.library.path }}
run: |
pytest
poetry run pytest
49 changes: 26 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,37 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
environment: pypi_prod
needs: [build]
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install flit
- name: Install dependencies
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}

release:
name: Create release
runs-on: ubuntu-latest
needs: [publish]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }}
python -m pip install --upgrade poetry
- name: Publish kiota_abstractions to PyPI
run: poetry publish --build
working-directory: "./packages/abstractions"
- name: Publish kiota_authentication_azure to PyPI
run: poetry publish --build
working-directory: "./packages/authentication/azure"
- name: Publish kiota_http to PyPI
run: poetry publish --build
working-directory: "./packages/http/httpx"
- name: Publish kiota_serialization_form to PyPI
run: poetry publish --build
working-directory: "./packages/serialization/form"
- name: Publish kiota_serialization_json to PyPI
run: poetry publish --build
working-directory: "./packages/serialization/json"
- name: Publish kiota_serialization_text to PyPI
run: poetry publish --build
working-directory: "./packages/serialization/text"
- name: Publish kiota_serialization_multipart to PyPI
run: poetry publish --build
working-directory: "./packages/serialization/multipart"

12 changes: 0 additions & 12 deletions Makefile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions packages/abstractions/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "microsoft-kiota-abstractions"
version = "0.0.4"
description = "Core abstractions for kiota generated libraries in Python"
authors = ["Microsoft <[email protected]>"]
license = "MIT"
readme = "README.md"
keywords = ["kiota", "openAPI", "Microsoft", "Graph"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
]
homepage = "https://github.com/microsoft/kiota#readme"
repository = "https://github.com/microsoft/kiota-python"
documentation = "https://microsoft.github.io/kiota/"
packages = [{include = "kiota_abstractions"}]

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
std-uritemplate = ">=0.0.38"
opentelemetry-api = ">=1.19.0"
opentelemetry-sdk = ">=1.19.0"

[tool.poetry.group.dev.dependencies]
yapf = "^0.40.2"
isort = "^5.13.2"
pylint = "^3.2.7"
mypy = "^1.11.2"
pytest = "^8.3.2"
pytest-asyncio = "^0.24.0"
poetry-plugin-mono-repo-deps = "^0.2.1"

[mypy]
warn_unused_configs = true
files = "kiota_abstractions"

[tool.yapf]
based_on_style = "pep8"
dedent_closing_brackets = true
each_dict_entry_on_separate_line = true
column_limit = 100

[tool.isort]
profile = "hug"

[tool.poetry-monorepo.deps]
enabled = true
commands = ["build", "export", "publish"]
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import pytest

from kiota_abstractions.authentication import (
ApiKeyAuthenticationProvider,
KeyLocation,
AuthenticationProvider,
)
from kiota_abstractions.authentication import ApiKeyAuthenticationProvider, AuthenticationProvider, KeyLocation

allowed_hosts = ["https://example.com"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Parsable,
ParseNode,
SerializationWriter,
SerializationWriterFactory
SerializationWriterFactory,
)
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest


def test_backed_model_return_only_changed_values_false(mock_user):
# Getters retrieve all values from backing store
assert mock_user.id == "84b3f7bf-6afb-46b2-9c6d-660c9b8c8ea0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
# See License in the project root for license information.
# ------------------------------------------------------------------------------

from typing import Any, Callable, TypeVar, Generic, List, Tuple
from typing import Any, Callable, Generic, List, Tuple, TypeVar

import pytest

from kiota_abstractions.store import (
BackingStoreFactorySingleton,
InMemoryBackingStoreFactory,
)
from kiota_abstractions.store import BackingStoreFactorySingleton, InMemoryBackingStoreFactory
from kiota_abstractions.store.backing_store import BackingStore
from kiota_abstractions.store.backing_store_factory import BackingStoreFactory
from kiota_abstractions.store.in_memory_backing_store import InMemoryBackingStore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pytest

from kiota_abstractions.store import InMemoryBackingStore

from tests.conftest import MockEntity

BUSINESS_PHONES_KEY = "business_phones"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import pytest

from kiota_abstractions.serialization import SerializationWriter
from kiota_abstractions.multipart_body import MultipartBody
from kiota_abstractions.serialization import SerializationWriter


def test_defensive():
"""Tests initialization of MultipartBody objects
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from kiota_abstractions.headers_collection import HeadersCollection


def test_defensive():
"""Tests initialization of RequestHeader objects
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
from datetime import datetime
import uuid
import pytest
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
from unittest.mock import Mock

from kiota_abstractions.request_information import RequestInformation
from kiota_abstractions.headers_collection import HeadersCollection
import pytest

from kiota_abstractions.base_request_configuration import RequestConfiguration
from kiota_abstractions.headers_collection import HeadersCollection
from kiota_abstractions.method import Method
from kiota_abstractions.request_information import RequestInformation


from .conftest import TestEnum, QueryParams

from .conftest import QueryParams, TestEnum


def test_initialization():
Expand Down
Loading
Loading