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

Migrating azure-monitor-opentelemetry to azure-sdk #30089

Merged
merged 9 commits into from
Aug 18, 2023

Conversation

jeremydvoss
Copy link
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jeremydvoss.

Noted some items needed for getting this ready for making this repository its home 😃 . Most of it just adding missing files (see the template project for the general idea):

  1. Add a dev_requirements.txt file which is used for ci/testing. I think the following contents are probably fine for now.

    -e ../../../tools/azure-sdk-tools
    -e ../../../tools/azure-devtools
    

    along with the rest of your test requirements.

  2. Add a CHANGELOG.md file. Formatting guidance can be found here, but pretty much formatted like:

    # Release History
    
    ## 1.0.0b12 (Unreleased)
    
    ### Features Added
    
    ### Breaking Changes
    
    ### Bugs Fixed
    
    ### Other Changes
    
  3. Add an sdk_packaging.toml file. Can just contain:

    [packaging]
    auto_update = false
    
  4. Add a pyproject.toml file with a section like:

    [tool.azure-sdk-build]
    type_check_samples = false
    verifytypes = false
    pyright = false
    

    Can also do pylint = false if you want to disable that too, but better to see if you can get it to pass first. Similarly with mypy = false.

  5. Add an empty py.typed file to the project (i.e., ./azure/monitor/opentelemetry/py.typed)

  6. Add a MANIFEST.in file. I think contents would be:

    recursive-include tests *.py
    recursive-include samples *.py
    include *.md
    include LICENSE
    include azure/__init__.py
    include azure/monitor/__init__.py
    include azure/monitor/opentelemetry/py.typed
    
  7. Can remove setup.cfg as it's not needed.

  8. Add the project to the Artifacts list in ci.yml

  9. Update https://github.com/Azure/azure-sdk-for-python/blob/main/shared_requirements.txt with package names that are included in your setup.py dependencies but not listed there.

Copy link
Member

@annatisch annatisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this started @jeremydvoss!
Could you please update ci.yml in the monitor root directoy to include your package artifacts?
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/ci.yml#L32-L40

@jeremydvoss
Copy link
Member Author

jeremydvoss commented May 22, 2023

Thanks, @jeremydvoss.

Noted some items needed for getting this ready for making this repository its home 😃 ...

Done.

@jeremydvoss
Copy link
Member Author

PR for vendoring: microsoft/ApplicationInsights-Python#280

@lmolkova
Copy link
Member

lmolkova commented Jun 7, 2023

/azp run python - monitor - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-monitor-opentelemetry

Copy link
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments inline that should hopefully help with the pipeline failures. Not sure why it's pulling the exporter package locally though. Will need to spend more time investigating that.

To clean up the mypy errors from the _vendor files, you can add a mypy.ini in the same level as setup.py with contents like the following:

[mypy]
warn_return_any = True
ignore_missing_imports = True

[mypy-azure.monitor.opentelemetry._vendor.*]
ignore_errors = True

NOTICE.txt Outdated Show resolved Hide resolved
Copy link
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs a rebase/merge with main with the conflict resolved so that the checks can run. Left a couple comments inline.

sdk/monitor/azure-monitor-opentelemetry/mypi.ini Outdated Show resolved Hide resolved
sdk/monitor/azure-monitor-opentelemetry/setup.py Outdated Show resolved Hide resolved
@jeremydvoss
Copy link
Member Author

Ubuntu tests failing seems to stem from the following error:

.tox/mindependency/lib/python3.11/site-packages/wrapt/decorators.py:34: in <module>
    from inspect import ismethod, isclass, formatargspec
E   ImportError: cannot import name 'formatargspec' from 'inspect' (/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/inspect.py)
whl: OK ✔ in 44.51 seconds
sdist: OK ✔ in 49.91 seconds
  whl: OK (44.51=setup[37.01]+cmd[0.12,4.88,0.24,2.25] seconds)
  sdist: OK (49.91=setup[40.60]+cmd[7.46,0.23,1.63] seconds)
  mindependency: FAIL code 4 (115.93=setup[26.96]+cmd[87.16,1.11,0.23,0.13,0.34] seconds)
  evaluation failed :( (116.01 seconds)
ERROR:root:Command '['/opt/hostedtoolcache/Python/3.11.4/x64/bin/python', '-m', 'tox', 'run-parallel', '-p', 'all', '--root', '.', '-c', '/mnt/vss/_work/1/s/eng/tox/tox.ini', '-e', 'whl,sdist,mindependency', '--', '--no-cov', '--ignore', 'azure_monitor_opentelemetry.egg-info']' returned non-zero exit status 255.

@jeremydvoss
Copy link
Member Author

jeremydvoss commented Jul 20, 2023

cannot import name 'formatargspec' from 'inspect'

GrahamDumpleton/wrapt#196
Though the issue is closed, wrapt has not been released since February. I am not sure how to fix this now.

Copy link
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the Python 3.11 compatibility for wrapt was added in 1.14.0. Can try using that as a min.

https://wrapt.readthedocs.io/en/latest/changes.html#version-1-14-0

@jeremydvoss jeremydvoss marked this pull request as ready for review July 27, 2023 17:41
@annatisch
Copy link
Member

/azp run python - monitor - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jeremydvoss jeremydvoss merged commit 1a506bf into Azure:main Aug 18, 2023
16 checks passed
lmazuel pushed a commit that referenced this pull request Aug 21, 2023
* Add azure-monitor-opentelemetry to Azure SDK

* unpin api/sdk. Pull from source repo branch

* Added importlib specification

* Added extra quote chars

* setup typo

* importlib-metadata

* Fix diagnostic logs tests for concurrency tests

* fix status logger tests for concurrency

---------

Co-authored-by: Anna Tisch <antisch@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants