Skip to content

Commit

Permalink
Use correct expectations for PyPI #1749
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Oct 16, 2019
1 parent ec7ce1b commit 95c44ee
Show file tree
Hide file tree
Showing 22 changed files with 145 additions and 40 deletions.
86 changes: 80 additions & 6 deletions tests/packagedcode/data/plugin/python-package-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@
"description": "===================\npython-atomicwrites\n===================\n\n.. image:: https://travis-ci.org/untitaker/python-atomicwrites.svg?branch=master\n :target: https://travis-ci.org/untitaker/python-atomicwrites\n\n.. image:: https://ci.appveyor.com/api/projects/status/vadc4le3c27to59x/branch/master?svg=true\n :target: https://ci.appveyor.com/project/untitaker/python-atomicwrites/branch/master\n\nAtomic file writes.\n\n.. code-block:: python\n\n from atomicwrites import atomic_write\n\n with atomic_write('foo.txt', overwrite=True) as f:\n f.write('Hello world.')\n # \"foo.txt\" doesn't exist yet.\n\n # Now it does.\n\n\nFeatures that distinguish it from other similar libraries (see `Alternatives and Credit`_):\n\n- Race-free assertion that the target file doesn't yet exist. This can be\n controlled with the ``overwrite`` parameter.\n\n- Windows support, although not well-tested. The MSDN resources are not very\n explicit about which operations are atomic. I'm basing my assumptions off `a\n comment\n <https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/449bb49d-8acc-48dc-a46f-0760ceddbfc3/movefileexmovefilereplaceexisting-ntfs-same-volume-atomic?forum=windowssdk#a239bc26-eaf0-4920-9f21-440bd2be9cc8>`_\n by `Doug Crook\n <https://social.msdn.microsoft.com/Profile/doug%20e.%20cook>`_, who appears\n to be a Microsoft employee:\n\n FAQ: Is MoveFileEx atomic\n Frequently asked question: Is MoveFileEx atomic if the existing and new\n files are both on the same drive?\n\n The simple answer is \"usually, but in some cases it will silently fall-back\n to a non-atomic method, so don't count on it\".\n\n The implementation of MoveFileEx looks something like this: [...]\n\n The problem is if the rename fails, you might end up with a CopyFile, which\n is definitely not atomic.\n\n If you really need atomic-or-nothing, you can try calling\n NtSetInformationFile, which is unsupported but is much more likely to be\n atomic. \n\n- Simple high-level API that wraps a very flexible class-based API.\n\n- Consistent error handling across platforms.\n\n\nHow it works\n============\n\nIt uses a temporary file in the same directory as the given path. This ensures\nthat the temporary file resides on the same filesystem.\n\nThe temporary file will then be atomically moved to the target location: On\nPOSIX, it will use ``rename`` if files should be overwritten, otherwise a\ncombination of ``link`` and ``unlink``. On Windows, it uses MoveFileEx_ through\nstdlib's ``ctypes`` with the appropriate flags.\n\nNote that with ``link`` and ``unlink``, there's a timewindow where the file\nmight be available under two entries in the filesystem: The name of the\ntemporary file, and the name of the target file.\n\nAlso note that the permissions of the target file may change this way. In some\nsituations a ``chmod`` can be issued without any concurrency problems, but\nsince that is not always the case, this library doesn't do it by itself.\n\n.. _MoveFileEx: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365240%28v=vs.85%29.aspx\n\nfsync\n-----\n\nOn POSIX, ``fsync`` is invoked on the temporary file after it is written (to\nflush file content and metadata), and on the parent directory after the file is\nmoved (to flush filename).\n\n``fsync`` does not take care of disks' internal buffers, but there don't seem\nto be any standard POSIX APIs for that. On OS X, ``fcntl`` is used with\n``F_FULLFSYNC`` instead of ``fsync`` for that reason.\n\nOn Windows, `_commit <https://msdn.microsoft.com/en-us/library/17618685.aspx>`_\nis used, but there are no guarantees about disk internal buffers.\n\nAlternatives and Credit\n=======================\n\nAtomicwrites is directly inspired by the following libraries (and shares a\nminimal amount of code):\n\n- The Trac project's `utility functions\n <http://www.edgewall.org/docs/tags-trac-0.11.7/epydoc/trac.util-pysrc.html>`_,\n also used in `Werkzeug <http://werkzeug.pocoo.org/>`_ and\n `mitsuhiko/python-atomicfile\n <https://github.com/mitsuhiko/python-atomicfile>`_. The idea to use\n ``ctypes`` instead of ``PyWin32`` originated there.\n\n- `abarnert/fatomic <https://github.com/abarnert/fatomic>`_. Windows support\n (based on ``PyWin32``) was originally taken from there.\n\nOther alternatives to atomicwrites include:\n\n- `sashka/atomicfile <https://github.com/sashka/atomicfile>`_. Originally I\n considered using that, but at the time it was lacking a lot of features I\n needed (Windows support, overwrite-parameter, overriding behavior through\n subclassing).\n\n- The `Boltons library collection <https://github.com/mahmoud/boltons>`_\n features a class for atomic file writes, which seems to have a very similar\n ``overwrite`` parameter. It is lacking Windows support though.\n\nLicense\n=======\n\nLicensed under the MIT, see ``LICENSE``.\n\n\n",
"release_date": null,
"parties": [],
"keywords": [],
"keywords": [
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython"
],
"homepage_url": "https://github.com/untitaker/python-atomicwrites",
"download_url": null,
"size": null,
Expand All @@ -65,7 +73,10 @@
"copyright": null,
"license_expression": "mit",
"declared_license": {
"license": "MIT"
"license": "MIT",
"classifiers": [
"License :: OSI Approved :: MIT License"
]
},
"notice_text": null,
"root_path": "atomicwrites-1.2.1-py2.py3-none-any.whl",
Expand All @@ -83,7 +94,62 @@
{
"path": "metadata.json",
"type": "file",
"packages": [],
"packages": [
{
"type": "pypi",
"namespace": null,
"name": "six",
"version": "1.10.0",
"qualifiers": null,
"subpath": null,
"primary_language": "Python",
"description": "Python 2 and 3 compatibility utilities",
"release_date": null,
"parties": [
{
"type": "person",
"role": "contact",
"name": "Benjamin Peterson",
"email": null,
"url": null
}
],
"keywords": [
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities"
],
"homepage_url": "http://pypi.python.org/pypi/six/",
"download_url": null,
"size": null,
"sha1": null,
"md5": null,
"sha256": null,
"sha512": null,
"bug_tracking_url": null,
"code_view_url": null,
"vcs_url": null,
"copyright": null,
"license_expression": "mit",
"declared_license": {
"license": "MIT",
"classifiers": [
"License :: OSI Approved :: MIT License"
]
},
"notice_text": null,
"root_path": "metadata.json",
"dependencies": [],
"contains_source_code": null,
"source_packages": [],
"purl": "pkg:pypi/six@1.10.0",
"repository_homepage_url": null,
"repository_download_url": null,
"api_data_url": null
}
],
"scan_errors": []
},
{
Expand All @@ -100,7 +166,15 @@
"primary_language": "Python",
"description": "Library for accessing \"ar\" files",
"release_date": null,
"parties": [],
"parties": [
{
"type": "person",
"role": "author",
"name": "Stanis\u0142aw Pitucha",
"email": "viraptor@gmail.com",
"url": null
}
],
"keywords": [],
"homepage_url": "http://bitbucket.org/viraptor/arpy",
"download_url": null,
Expand All @@ -113,9 +187,9 @@
"code_view_url": null,
"vcs_url": null,
"copyright": null,
"license_expression": null,
"license_expression": "bsd-simplified",
"declared_license": {
"license": null,
"license": "Simplified BSD",
"classifiers": []
},
"notice_text": null,
Expand Down
14 changes: 11 additions & 3 deletions tests/packagedcode/data/pypi/setup.py/arpy_setup.py-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@
"primary_language": "Python",
"description": "Library for accessing \"ar\" files",
"release_date": null,
"parties": [],
"parties": [
{
"type": "person",
"role": "author",
"name": "Stanis\u0142aw Pitucha",
"email": "viraptor@gmail.com",
"url": null
}
],
"keywords": [],
"homepage_url": "http://bitbucket.org/viraptor/arpy",
"download_url": null,
Expand All @@ -21,9 +29,9 @@
"code_view_url": null,
"vcs_url": null,
"copyright": null,
"license_expression": null,
"license_expression": "bsd-simplified",
"declared_license": {
"license": null,
"license": "Simplified BSD",
"classifiers": []
},
"notice_text": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Sebastian Kraemer",
"email": null,
"email": "basti.kr@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Ian Main",
"email": null,
"email": "imain@redhat.com",
"url": null
}
],
Expand All @@ -39,7 +39,7 @@
"code_view_url": null,
"vcs_url": null,
"copyright": null,
"license_expression": "unknown AND apache-2.0",
"license_expression": "apache-2.0",
"declared_license": {
"license": "Apache Software License",
"classifiers": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@
"primary_language": "Python",
"description": "Python bindings for the Apache Thrift FB303",
"release_date": null,
"parties": [],
"parties": [
{
"type": "person",
"role": "author",
"name": [
"Thrift Developers"
],
"email": [
"dev@thrift.apache.org"
],
"url": null
}
],
"keywords": [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Chromium Authors",
"email": null,
"email": "chromium-dev@googlegroups.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Brent S Pedersen",
"email": null,
"email": "bpederse@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "MirrorBrain project",
"email": null,
"email": "info@mirrorbrain.org",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"qualifiers": null,
"subpath": null,
"primary_language": "Python",
"description": "A Python module to manipulate NTFS hard links and junctions.\", long_description=long_description, classifiers=[ 'Intended Audience :: Developers",
"description": "A Python module to manipulate NTFS hard links and junctions.",
"release_date": null,
"parties": [
{
"type": "person",
"role": "author",
"name": "Siddharth Agarwal",
"email": null,
"email": "sid.bugzilla@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "lilydjwg",
"email": null,
"email": "lilydjwg@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "__author__",
"email": null,
"email": "juga@riseup.net",
"url": null
}
],
Expand All @@ -27,7 +27,7 @@
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities"
],
"homepage_url": "https://github.com/openintegrity/agents-common-code",
"homepage_url": "https://lab.openintegrity.org/agents/agents-common-code",
"download_url": null,
"size": null,
"sha1": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Vineet Naik",
"email": null,
"email": "naikvin@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"qualifiers": null,
"subpath": null,
"primary_language": "Python",
"description": "A simple module that will print the dependencies of a python project' 'Usage: python -m pydep <dir>",
"description": "A simple module that will print the dependencies of a python projectUsage: python -m pydep <dir>",
"release_date": null,
"parties": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"qualifiers": null,
"subpath": null,
"primary_language": "Python",
"description": "A pure python rpm reader and YUM metadata generator\", author=\"Stefan Richter\", author_email=\"stefan@02strich.de\", url=\"https://github.com/02strich/pyrpm\", license=\"BSD\", classifiers=[ 'Development Status :: 4 - Beta",
"description": "A pure python rpm reader and YUM metadata generator",
"release_date": null,
"parties": [
{
"type": "person",
"role": "author",
"name": "Stefan Richter\", author_email=\"stefan@02strich.de\", url=\"https://github.com/02strich/pyrpm\", license=\"BSD\", classifiers=[ 'Development Status :: 4 - Beta",
"email": null,
"name": "Stefan Richter",
"email": "stefan@02strich.de",
"url": null
}
],
Expand All @@ -30,7 +30,7 @@
"Programming Language :: Python :: 3.1",
"Topic :: Software Development :: Libraries"
],
"homepage_url": "https://github.com/02strich/pyrpm\", license=\"BSD\", classifiers=[ 'Development Status :: 4 - Beta",
"homepage_url": "https://github.com/02strich/pyrpm",
"download_url": null,
"size": null,
"sha1": null,
Expand All @@ -43,7 +43,7 @@
"copyright": null,
"license_expression": "unknown AND bsd-new",
"declared_license": {
"license": "BSD\", classifiers=[ 'Development Status :: 4 - Beta",
"license": "BSD",
"classifiers": [
"License :: OSI Approved :: BSD License"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Tomaz Solc",
"email": null,
"email": "tomaz.solc@tablix.org",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Dmitry Marakasov",
"email": null,
"email": "amdmi3@amdmi3.ru",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"qualifiers": null,
"subpath": null,
"primary_language": "Python",
"description": "Dump readable YAML and load safely any YAML preserving ' 'ordering and avoiding surprises of type conversions. ' 'This library is a PyYaml wrapper with sane behaviour to read and ' 'write readable YAML safely, typically when used for configuration.",
"description": "Dump readable YAML and load safely any YAML preserving ordering and avoiding surprises of type conversions. This library is a PyYaml wrapper with sane behaviour to read and write readable YAML safely, typically when used for configuration.",
"release_date": null,
"parties": [
{
"type": "person",
"role": "author",
"name": "AboutCode authors and others.",
"email": null,
"email": "info@nexb.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "ScanCode",
"email": null,
"email": "info@scancode.io",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "person",
"role": "author",
"name": "Marc Abramowitz",
"email": null,
"email": "msabramo@gmail.com",
"url": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"type": "person",
"role": "author",
"name": "Dan Lecocq",
"email": null,
"email": "dan@seomoz.org",
"url": null
}
],
"keywords": [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP']"
"Topic :: Internet :: WWW/HTTP"
],
"homepage_url": "http://github.com/nexB/url-py",
"download_url": null,
Expand Down
Loading

0 comments on commit 95c44ee

Please sign in to comment.