diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..9d1d1d9c --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +manifest: true +primaryBranch: main +handleGHRelease: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1796451b..7b2793d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,10 +21,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -51,5 +51,3 @@ jobs: 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 }} - - diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..b018ce6b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.1" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b8aef12..0c92d211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,20 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [1.0.1] - 2024-04-22 ### Added ### Changed - -Enabled Large File Upload and Page iterator support + -Enabled Large File Upload and Page iterator support ## [1.0.0] - 2023-10-31 ### Added ### Changed + - GA release. ## [1.0.0a6] - 2023-10-12 @@ -25,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Replaced default transport with graph transport when using custom client with proxy. ## [1.0.0a5] - 2023-06-20 diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst deleted file mode 100644 index 6257f2e7..00000000 --- a/CODE_OF_CONDUCT.rst +++ /dev/null @@ -1,9 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..79daa10b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to the Microsoft Graph Core SDK for Python + +The Microsoft Graph SDK for python is available for all manner of contribution. There are a couple of different recommended paths to get contributions into the released version of this SDK. + +__NOTE__ A signed a contribution license agreement is required for all contributions, and is checked automatically on new pull requests. Please read and sign [the agreement](https://cla.microsoft.com/) before starting any work for this repository. + +## File issues + +The best way to get started with a contribution is to start a dialog with the owners of this repository. Sometimes features will be under development or out of scope for this SDK and it's best to check before starting work on contribution. + +## Submit pull requests for trivial changes + +If you are making a change that does not affect the interface components and does not affect other downstream callers, feel free to make a pull request against the __main__ branch. The main branch will be updated frequently. + +Revisions of this nature will result in a 0.0.X change of the version number. + +## Submit pull requests for features + +If major functionality is being added, or there will need to be gestation time for a change, it should be submitted against the __feature__ branch. + +Revisions of this nature will result in a 0.X.X change of the version number. + +## Commit message format + +To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) +format. + +Each commit message consists of a **header**, an optional **body** and an optional **footer**. The header is the first line of the commit and +MUST have a **type** (see below for a list of types) and a **description**. An optional **scope** can be added to the header to give extra context. + +``` +[optional scope]: + + + + +``` + +The recommended commit types used are: + + - **feat** for feature updates (increments the _minor_ version) + - **fix** for bug fixes (increments the _patch_ version) + - **perf** for performance related changes e.g. optimizing an algorithm + - **refactor** for code refactoring changes + - **test** for test suite updates e.g. adding a test or fixing a test + - **style** for changes that don't affect the meaning of code. e.g. formatting changes + - **docs** for documentation updates e.g. ReadMe update or code documentation updates + - **build** for build system changes (gradle updates, external dependency updates) + - **ci** for CI configuration file changes e.g. updating a pipeline + - **chore** for miscallaneous non-sdk changesin the repo e.g. removing an unused file + +Adding a footer with the prefix **BREAKING CHANGE:** will cause an increment of the _major_ version. + diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 80b94218..00000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,395 +0,0 @@ -Contributing -============ - -- `Ways to contribute <#ways-to-contribute>`__ -- `Contribute using GitHub <#contribute-using-github>`__ -- `Contribute using Git <#contribute-using-git>`__ -- `How to use Markdown to format your - topic <#how-to-use-markdown-to-format-your-topic>`__ -- `FAQ <#faq>`__ -- `More resources <#more-resources>`__ - -Ways to contribute ------------------- - -Here are some ways you can contribute to this documentation: - -- To make small changes to an article, `Contribute using - GitHub <#contribute-using-github>`__. -- To make large changes, or changes that involve code, `Contribute - using Git <#contribute-using-git>`__. -- Report documentation bugs via GitHub Issues -- Request new documentation at the `Office Developer Platform - UserVoice `__ site. - -Contribute using GitHub ------------------------ - -Use GitHub to contribute to this documentation without having to clone -the repository to your desktop. This is the easiest way to create a pull -request in this repository. Use this method to make a minor change that -doesn't involve code changes. - -**Note** Using this method allows you to contribute to one article at a -time. - -To Contribute using GitHub -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -#. Find the article you want to contribute to on GitHub. - - If the article is in MSDN, choose the **suggest and submit changes** - link in the **Contribute to this content** section and you'll be - taken to the same article on GitHub. - -#. Once you are on the article in GitHub, sign in to GitHub (get a free - account `Join GitHub `__. -#. Choose the **pencil icon** (edit the file in your fork of this - project) and make your changes in the **<>Edit file** window. -#. Scroll to the bottom and enter a description. -#. Choose **Propose file change**>\ **Create pull request**. - -You now have successfully submitted a pull request. Pull requests are -typically reviewed within 10 business days. - -Contribute using Git --------------------- - -Use Git to contribute substantive changes, such as: - -- Contributing code. -- Contributing changes that affect meaning. -- Contributing large changes to text. -- Adding new topics. - -To Contribute using Git -~~~~~~~~~~~~~~~~~~~~~~~ - -#. If you don't have a GitHub account, set one up at - `GitHub `__. -#. After you have an account, install Git on your computer. Follow the - steps in `Setting up Git - Tutorial `__. -#. To submit a pull request using Git, follow the steps in `Use GitHub, - Git, and this repository <#use-github-git-and-this-repository>`__. -#. You will be asked to sign the Contributor's License Agreement if you - are: - - - A member of the Microsoft Open Technologies group. - - A contributors who doesn't work for Microsoft. - -As a community member, you must sign the Contribution License Agreement -(CLA) before you can contribute large submissions to a project. You only -need to complete and submit the documentation once. Carefully review the -document. You may be required to have your employer sign the document. - -Signing the CLA does not grant you rights to commit to the main -repository, but it does mean that the Office Developer and Office -Developer Content Publishing teams will be able to review and approve -your contributions. You will be credited for your submissions. - -Pull requests are typically reviewed within 10 business days. - -Use GitHub, Git, and this repository ------------------------------------- - -**Note:** Most of the information in this section can be found in -`GitHub Help `__ articles. If you're familiar -with Git and GitHub, skip to the **Contribute and edit content** section -for the specifics of the code/content flow of this repository. - -To set up your fork of the repository -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -#. Set up a GitHub account so you can contribute to this project. If you - haven't done this, go to `GitHub `__ and do - it now. -#. Install Git on your computer. Follow the steps in the `Setting up Git - Tutorial `__. -#. Create your own fork of this repository. To do this, at the top of - the page, choose the **Fork** button. -#. Copy your fork to your computer. To do this, open Git Bash. At the - command prompt enter: - - :: - - git clone https://github.com//.git - - Next, create a reference to the root repository by entering these - commands: - - :: - - cd - git remote add upstream https://github.com/microsoftgraph/.git - git fetch upstream - -Congratulations! You've now set up your repository. You won't need to -repeat these steps again. - -Contribute and edit content -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To make the contribution process as seamless as possible, follow these -steps. - -To contribute and edit content -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -#. Create a new branch. -#. Add new content or edit existing content. -#. Submit a pull request to the main repository. -#. Delete the branch. - -**Important** Limit each branch to a single concept/article to -streamline the work flow and reduce the chance of merge conflicts. -Content appropriate for a new branch includes: - -- A new article. -- Spelling and grammar edits. -- Applying a single formatting change across a large set of articles - (for example, applying a new copyright footer). - -To create a new branch -^^^^^^^^^^^^^^^^^^^^^^ - -1.Open Git Bash. 2.At the Git Bash command prompt, type -``git pull upstream master:``. This creates a new -branch locally that is copied from the latest MicrosoftGraph master -branch. 3.At the Git Bash command prompt, type -``git push origin ``. This alerts GitHub to the new -branch. You should now see the new branch in your fork of the repository -on GitHub. 4.At the Git Bash command prompt, type -``git checkout `` to switch to your new branch. - -Add new content or edit existing content -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -You navigate to the repository on your computer by using File Explorer. -The repository files are in ``C:\Users\\``. - -To install dependencies that are necessary for development run, - -.. code:: - - pip3 install -r requirements.txt - pip3 install -r dev_requirements.txt - -To edit files, open them in an editor of your choice and modify them. To -create a new file, use the editor of your choice and save the new file -in the appropriate location in your local copy of the repository. While -working, save your work frequently. - -*Note: Make sure to add unit tests to validate you changes.* - -| Once you have done with your changes, You have to build and test your changes - -| To install the library run, - -.. code:: - - flit install - -To run tests, - -.. code:: - - python3 -m unittest discover tests/unit - python3 -m unittest discover tests/integration - -To run linting, - -.. code:: - - pylint src/ - - -The files in ``C:\Users\\`` are a working copy -of the new branch that you created in your local repository. Changing -anything in this folder doesn't affect the local repository until you -commit a change. To commit a change to the local repository, type the -following commands in GitBash: - -:: - - git add . - git commit -v -a -m "" - -The ``add`` command adds your changes to a staging area in preparation -for committing them to the repository. The period after the ``add`` -command specifies that you want to stage all of the files that you added -or modified, checking sub folders recursively. (If you don't want to -commit all of the changes, you can add specific files. You can also undo -a commit. For help, type ``git add -help`` or ``git status``.) - -The ``commit`` command applies the staged changes to the repository. The -switch ``-m`` means you are providing the commit comment in the command -line. The -v and -a switches can be omitted. The -v switch is for -verbose output from the command, and -a does what you already did with -the add command. - -You can commit multiple times while you are doing your work, or you can -commit once when you're done. - -Submit a pull request to the main repository -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -When you're finished with your work and are ready to have it merged into -the main repository, follow these steps. - -To submit a pull request to the main repository -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -#. In the Git Bash command prompt, type - ``git push origin ``. In your local repository, - ``origin`` refers to your GitHub repository that you cloned the local - repository from. This command pushes the current state of your new - branch, including all commits made in the previous steps, to your - GitHub fork. -#. On the GitHub site, navigate in your fork to the new branch. -#. Choose the **Pull Request** button at the top of the page. -#. Verify the Base branch is ``microsoftgraph/@master`` and - the Head branch is ``/@``. -#. Choose the **Update Commit Range** button. -#. Add a title to your pull request, and describe all the changes you're - making. -#. Submit the pull request. - -One of the site administrators will process your pull request. Your pull -request will surface on the microsoftgraph/ site under Issues. When the -pull request is accepted, the issue will be resolved. - -Create a new branch after merge -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -After a branch is successfully merged (that is, your pull request is -accepted), don't continue working in that local branch. This can lead to -merge conflicts if you submit another pull request. To do another -update, create a new local branch from the successfully merged upstream -branch, and then delete your initial local branch. - -For example, if your local branch X was successfully merged into the -OfficeDev/microsoft-graph-docs master branch and you want to make -additional updates to the content that was merged. Create a new local -branch, X2, from the OfficeDev/microsoft-graph-docs master branch. To do -this, open GitBash and execute the following commands: - -:: - - cd microsoft-graph-docs - git pull upstream master:X2 - git push origin X2 - -You now have local copies (in a new local branch) of the work that you -submitted in branch X. The X2 branch also contains all the work other -writers have merged, so if your work depends on others' work (for -example, shared images), it is available in the new branch. You can -verify that your previous work (and others' work) is in the branch by -checking out the new branch... - -:: - - git checkout X2 - -...and verifying the content. (The ``checkout`` command updates the -files in ``C:\Users\\microsoft-graph-docs`` to the current -state of the X2 branch.) Once you check out the new branch, you can make -updates to the content and commit them as usual. However, to avoid -working in the merged branch (X) by mistake, it's best to delete it (see -the following **Delete a branch** section). - -Delete a branch -^^^^^^^^^^^^^^^ - -Once your changes are successfully merged into the main repository, -delete the branch you used because you no longer need it. Any additional -work should be done in a new branch. - -To delete a branch -^^^^^^^^^^^^^^^^^^ - -#. In the Git Bash command prompt, type ``git checkout master``. This - ensures that you aren't in the branch to be deleted (which isn't - allowed). -#. Next, at the command prompt, type ``git branch -d ``. - This deletes the branch on your computer only if it has been - successfully merged to the upstream repository. (You can override - this behavior with the ``–D`` flag, but first be sure you want to do - this.) -#. Finally, type ``git push origin :`` at the command - prompt (a space before the colon and no space after it). This will - delete the branch on your github fork. - -Congratulations, you have successfully contributed to the project! - -How to use Markdown to format your topic ----------------------------------------- - -Article template -~~~~~~~~~~~~~~~~ - -The `markdown -template `__ contains -the basic Markdown for a topic that includes a table of contents, -sections with subheadings, links to other Office developer topics, links -to other sites, bold text, italic text, numbered and bulleted lists, -code snippets, and images. - -Standard Markdown -~~~~~~~~~~~~~~~~~ - -All of the articles in this repository use Markdown. A complete -introduction (and listing of all the syntax) can be found at `Markdown -Home `__. - -FAQ ---- - -How do I get a GitHub account? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Fill out the form at `Join GitHub `__ to open a -free GitHub account. - -Where do I get a Contributor's License Agreement? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You will automatically be sent a notice that you need to sign the -Contributor's License Agreement (CLA) if your pull request requires one. - -As a community member, **you must sign the Contribution License -Agreement (CLA) before you can contribute large submissions to this -project**. You only need complete and submit the documentation once. -Carefully review the document. You may be required to have your employer -sign the document. - -What happens with my contributions? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When you submit your changes, via a pull request, our team will be -notified and will review your pull request. You will receive -notifications about your pull request from GitHub; you may also be -notified by someone from our team if we need more information. We -reserve the right to edit your submission for legal, style, clarity, or -other issues. - -Can I become an approver for this repository's GitHub pull requests? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Currently, we are not allowing external contributors to approve pull -requests in this repository. - -How soon will I get a response about my change request or issue? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We typically review pull requests and respond to issues within 10 -business days. - -More resources --------------- - -- To learn more about Markdown, go to the Git creator's site `Daring - Fireball `__. -- To learn more about using Git and GitHub, first check out the `GitHub - Help section `__. - diff --git a/README.md b/README.md index b110c62f..fa1b959f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI Actions Status](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml/badge.svg)](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml) [![Downloads](https://pepy.tech/badge/msgraph-core)](https://pepy.tech/project/msgraph-core) -## Microsoft Graph Core Python Client Library. +## Microsoft Graph Core Python Client Library The Microsoft Graph Core Python Client Library contains core classes used by [Microsoft Graph Python Client Library](https://github.com/microsoftgraph/msgraph-sdk-python) to send native HTTP requests to [Microsoft Graph API](https://graph.microsoft.com). @@ -53,14 +53,14 @@ auth_provider = AzureIdentityAuthenticationProvider(credential) > **Note**: `AzureIdentityAuthenticationProvider` sets the default scopes and allowed hosts. -### 5. Pass the authentication provider object to the BaseGraphRequestAdapter constructor. +### 5. Pass the authentication provider object to the BaseGraphRequestAdapter constructor ```python from msgraph_core import BaseGraphRequestAdapter adapter = BaseGraphRequestAdapter(auth_provider) ``` -### 6. Make a requests to the graph. +### 6. Make a requests to the graph After you have a `BaseGraphRequestAdapter` that is authenticated, you can begin making calls against the service. @@ -86,7 +86,7 @@ View or log issues on the [Issues](https://github.com/microsoftgraph/msgraph-sdk ## Contributing -Please see the [contributing guidelines](CONTRIBUTING.rst). +Please see the [contributing guidelines](CONTRIBUTING.md). ## Copyright and license diff --git a/pyproject.toml b/pyproject.toml index 84d9ea3e..b9c4cd99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "msgraph-core" -version = "1.0.0" +# The SDK version +# x-release-please-start-version +version = "1.0.1" +# x-release-please-end authors = [{name = "Microsoft", email = "graphtooling+python@microsoft.com"}] description = "Core component of the Microsoft Graph Python SDK" dependencies = [ @@ -23,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", ] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..e36a1fbb --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,23 @@ +{ + "bootstrap-sha": "69079661c12dbfe6bf0c7cc379597d0c6c49e6f8", + "exclude-paths": [ + ".git", + ".idea", + ".github", + ".vscode" + ], + "release-type": "python", + "include-component-in-tag": false, + "include-v-in-tag": true, + "packages": { + ".": { + "package-name": "msgraph-core", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + "pyproject.toml", + "msgraph-core/_constants.py" + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file diff --git a/src/msgraph_core/_constants.py b/src/msgraph_core/_constants.py index 8dc32c1c..568c66b9 100644 --- a/src/msgraph_core/_constants.py +++ b/src/msgraph_core/_constants.py @@ -8,5 +8,8 @@ """ DEFAULT_REQUEST_TIMEOUT = 100 DEFAULT_CONNECTION_TIMEOUT = 30 +# The SDK version +# x-release-please-start-version SDK_VERSION = '1.0.1' +# x-release-please-end MS_DEFAULT_SCOPE = 'https://graph.microsoft.com/.default'