Git Product home page Git Product logo

protool's Introduction

protool

PyPi Version License

A tool for dealing with provisioning profiles.

What can it do?

  • Read profiles as XML or as a dictionary
  • Read the values from the profile
  • Diff two profiles to see what has changed

Installation

pip install protool

Examples:

import protool
profile = protool.ProvisioningProfile("/path/to/profile")

# Get the diff of two profiles
diff = protool.diff("/path/to/first", "/path/to/second", tool_override="diff")

# Get the UUID of a profile
print profile.uuid

# Get the full XML of the profile
print profile.xml

# Get the parsed contents of the profile as a dictionary
print profile.contents()

Alternatively, from the command line:

# Get the diff
protool diff --profiles /path/to/profile1 /path/to/profile2 --tool diff

# Get the UUID of a profile
protool read --profile /path/to/profile --key UUID

# Get the raw XML (identical to using `security cms -D -i /path/to/profile`)
protool decode --profile /path/to/profile

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

protool's People

Contributors

dalemyers avatar dependabot[bot] avatar egorbu avatar guojiubo avatar ilanvolow avatar jingshizheng avatar luras-oil avatar mattipv4 avatar microsoft-github-policy-service[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protool's Issues

Failed to install `typed-ast`

I encountered following error when running poetry install, it failed at installing typed-ast. Looks like we need to upgrade mypy? mypy 1.0.1 works fine.

$ poetry install                                                                                                                                                                                                      [14:04:08]
Installing dependencies from lock file

Package operations: 1 install, 22 updates, 0 removals

  • Updating pycparser (2.21 -> 2.20)
  • Updating attrs (22.2.0 -> 21.2.0)
  • Updating cffi (1.15.1 -> 1.14.5)
  • Updating iniconfig (2.0.0 -> 1.1.1)
  • Updating lazy-object-proxy (1.9.0 -> 1.6.0)
  • Updating packaging (23.0 -> 20.9)
  • Updating pluggy (1.0.0 -> 0.13.1)
  • Updating wrapt (1.15.0 -> 1.12.1)
  • Updating astroid (2.14.2 -> 2.5.6)
  • Updating click (8.1.3 -> 8.0.1)
  • Updating coverage (7.2.1 -> 5.5): Installing...
  • Updating isort (5.11.5 -> 5.8.0)
  • Updating mccabe (0.7.0 -> 0.6.1)
  • Updating mypy-extensions (1.0.0 -> 0.4.3)
  • Updating pathspec (0.11.0 -> 0.8.1)
  • Updating pytest (7.2.1 -> 6.2.4)
  • Installing typed-ast (1.4.3): Failed

  CalledProcessError

  Command '['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Building wheels for collected packages: typed-ast
  • Updating isort (5.11.5 -> 5.8.0)
  • Updating mccabe (0.7.0 -> 0.6.1)
  • Updating mypy-extensions (1.0.0 -> 0.4.3)
  • Updating pathspec (0.11.0 -> 0.8.1)
  • Updating pytest (7.2.1 -> 6.2.4)
  • Installing typed-ast (1.4.3): Failed

  CalledProcessError

  Command '['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Building wheels for collected packages: typed-ast
  • Updating coverage (7.2.1 -> 5.5)
  • Updating isort (5.11.5 -> 5.8.0)
  • Updating mccabe (0.7.0 -> 0.6.1)
  • Updating mypy-extensions (1.0.0 -> 0.4.3)
  • Updating pathspec (0.11.0 -> 0.8.1)
  • Updating pytest (7.2.1 -> 6.2.4)
  • Installing typed-ast (1.4.3): Failed

  CalledProcessError

  Command '['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/Users/guojiubo/Outlook/protool/venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/guojiubo/Outlook/protool/venv', '--no-deps', '/Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Building wheels for collected packages: typed-ast
    Building wheel for typed-ast (pyproject.toml): started
    Building wheel for typed-ast (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error
    
    × Building wheel for typed-ast (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [26 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build/lib.macosx-13-arm64-cpython-311
        creating build/lib.macosx-13-arm64-cpython-311/typed_ast
        copying typed_ast/conversions.py -> build/lib.macosx-13-arm64-cpython-311/typed_ast
        copying typed_ast/__init__.py -> build/lib.macosx-13-arm64-cpython-311/typed_ast
        copying typed_ast/ast3.py -> build/lib.macosx-13-arm64-cpython-311/typed_ast
        copying typed_ast/ast27.py -> build/lib.macosx-13-arm64-cpython-311/typed_ast
        creating build/lib.macosx-13-arm64-cpython-311/typed_ast/tests
        copying ast3/tests/test_basics.py -> build/lib.macosx-13-arm64-cpython-311/typed_ast/tests
        running build_ext
        building '_ast27' extension
        creating build/temp.macosx-13-arm64-cpython-311
        creating build/temp.macosx-13-arm64-cpython-311/ast27
        creating build/temp.macosx-13-arm64-cpython-311/ast27/Custom
        creating build/temp.macosx-13-arm64-cpython-311/ast27/Parser
        creating build/temp.macosx-13-arm64-cpython-311/ast27/Python
        clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -Iast27/Include -I/Users/guojiubo/Outlook/protool/venv/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c ast27/Custom/typed_ast.c -o build/temp.macosx-13-arm64-cpython-311/ast27/Custom/typed_ast.o
        In file included from ast27/Custom/typed_ast.c:3:
        ast27/Custom/../Include/compile.h:5:10: fatal error: 'code.h' file not found
        #include "code.h"
                 ^~~~~~~~
        1 error generated.
        error: command '/usr/bin/clang' failed with exit code 1
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for typed-ast
  Failed to build typed-ast
  ERROR: Could not build wheels for typed-ast, which is required to install pyproject.toml-based projects
  

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1540 in _run
      1536│                 output = subprocess.check_output(
      1537│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538│                 )
      1539│         except CalledProcessError as e:
    → 1540│             raise EnvCommandError(e, input=input_)
      1541│ 
      1542│         return decode(output)
      1543│ 
      1544│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:


  PoetryException

  Failed to install /Users/guojiubo/Library/Caches/pypoetry/artifacts/e8/b0/5f/4ab9773b62c82da44aa681d6aed60b263501dfb4d522dbeaa804479bf2/typed_ast-1.4.3.tar.gz

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/pip.py:58 in pip_install
       54│ 
       55│     try:
       56│         return environment.run_pip(*args)
       57│     except EnvCommandError as e:
    →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       59│ 

  • Updating typing-extensions (4.5.0 -> 3.10.0.0)
(venv) FAIL

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

It seems pyOpenSSL needs to be upgrade to >=21.0.0 (to work with cryptography 39.0.1) to fix following issue:

Exception has occurred: AttributeError
module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
  File "/Users/guojiubo/Outlook/protool/protool/__init__.py", line 16, in <module>
    import OpenSSL
  File "/Users/guojiubo/Outlook/protool/tests/test_parsing.py", line 9, in <module>
    import protool
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Associated changes: pyca/pyopenssl#982

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.