diff --git a/.eggs/README.txt b/.eggs/README.txt deleted file mode 100644 index 5d01668824f45c3a6683e12d1b9048bb1d273041..0000000000000000000000000000000000000000 --- a/.eggs/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. - -This directory caches those eggs to prevent repeated downloads. - -However, it is safe to delete this directory. - diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/LICENSE b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/LICENSE deleted file mode 100644 index 89de354795ec7a7cdab07c091029653d3618540d..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/PKG-INFO b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/PKG-INFO deleted file mode 100644 index 61039e21b7ad1d0b67bda0875485c42d72e48a98..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/PKG-INFO +++ /dev/null @@ -1,651 +0,0 @@ -Metadata-Version: 2.1 -Name: setuptools-scm -Version: 5.0.1 -Summary: the blessed package to manage your versions by scm tags -Home-page: https://github.com/pypa/setuptools_scm/ -Author: Ronny Pfannschmidt -Author-email: opensource@ronnypfannschmidt.de -License: MIT -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Topic :: Software Development :: Libraries -Classifier: Topic :: Software Development :: Version Control -Classifier: Topic :: System :: Software Distribution -Classifier: Topic :: Utilities -Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7 -Description-Content-Type: text/x-rst -Requires-Dist: setuptools -Provides-Extra: toml -Requires-Dist: toml ; extra == 'toml' - -setuptools_scm -============== - -``setuptools_scm`` handles managing your Python package versions -in SCM metadata instead of declaring them as the version argument -or in a SCM managed file. - -Additionally ``setuptools_scm`` provides setuptools with a list of files that are managed by the SCM -(i.e. it automatically adds all of the SCM-managed files to the sdist). -Unwanted files must be excluded by discarding them via ``MANIFEST.in``. - -``setuptools_scm`` support the following scm out of the box: - -* git -* mercurial - - - -.. image:: https://github.com/pypa/setuptools_scm/workflows/python%20tests+artifacts+release/badge.svg - :target: https://github.com/pypa/setuptools_scm/actions - -.. image:: https://tidelift.com/badges/package/pypi/setuptools-scm - :target: https://tidelift.com/subscription/pkg/pypi-setuptools-scm?utm_source=pypi-setuptools-scm&utm_medium=readme - - -``pyproject.toml`` usage ------------------------- - -The preferred way to configure ``setuptools_scm`` is to author -settings in a ``tool.setuptools_scm`` section of ``pyproject.toml``. - -This feature requires Setuptools 42 or later, released in Nov, 2019. -If your project needs to support build from sdist on older versions -of Setuptools, you will need to also implement the ``setup.py usage`` -for those legacy environments. - -First, ensure that ``setuptools_scm`` is present during the project's -built step by specifying it as one of the build requirements. - -.. code:: toml - - # pyproject.toml - [build-system] - requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] - -Note that the ``toml`` extra must be supplied. - -That will be sufficient to require ``setuptools_scm`` for projects -that support PEP 518 (`pip `_ and -`pep517 `_). Many tools, -especially those that invoke ``setup.py`` for any reason, may -continue to rely on ``setup_requires``. For maximum compatibility -with those uses, consider also including a ``setup_requires`` directive -(described below in ``setup.py usage`` and ``setup.cfg``). - -To enable version inference, add this section to your pyproject.toml: - -.. code:: toml - - # pyproject.toml - [tool.setuptools_scm] - -Including this section is comparable to supplying -``use_scm_version=True`` in ``setup.py``. Additionally, -include arbitrary keyword arguments in that section -to be supplied to ``get_version()``. For example: - -.. code:: toml - - # pyproject.toml - - [tool.setuptools_scm] - write_to = "pkg/version.py" - - -``setup.py`` usage ------------------- - -The following settings are considered legacy behavior and -superseded by the ``pyproject.toml`` usage, but for maximal -compatibility, projects may also supply the configuration in -this older form. - -To use ``setuptools_scm`` just modify your project's ``setup.py`` file -like this: - -* Add ``setuptools_scm`` to the ``setup_requires`` parameter. -* Add the ``use_scm_version`` parameter and set it to ``True``. - -For example: - -.. code:: python - - from setuptools import setup - setup( - ..., - use_scm_version=True, - setup_requires=['setuptools_scm'], - ..., - ) - -Arguments to ``get_version()`` (see below) may be passed as a dictionary to -``use_scm_version``. For example: - -.. code:: python - - from setuptools import setup - setup( - ..., - use_scm_version = { - "root": "..", - "relative_to": __file__, - "local_scheme": "node-and-timestamp" - }, - setup_requires=['setuptools_scm'], - ..., - ) - -You can confirm the version number locally via ``setup.py``: - -.. code-block:: shell - - $ python setup.py --version - -.. note:: - - If you see unusual version numbers for packages but ``python setup.py - --version`` reports the expected version number, ensure ``[egg_info]`` is - not defined in ``setup.cfg``. - - -``setup.cfg`` usage -------------------- - -If using `setuptools 30.3.0 -`_ -or greater, you can store ``setup_requires`` configuration in ``setup.cfg``. -However, ``use_scm_version`` must still be placed in ``setup.py``. For example: - -.. code:: python - - # setup.py - from setuptools import setup - setup( - use_scm_version=True, - ) - -.. code:: ini - - # setup.cfg - [metadata] - ... - - [options] - setup_requires = - setuptools_scm - ... - -.. important:: - - Ensure neither the ``[metadata]`` ``version`` option nor the ``[egg_info]`` - section are defined, as these will interfere with ``setuptools_scm``. - -You may also need to define a ``pyproject.toml`` file (`PEP-0518 -`_) to ensure you have the required -version of ``setuptools``: - -.. code:: ini - - # pyproject.toml - [build-system] - requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"] - -For more information, refer to the `setuptools issue #1002 -`_. - - -Programmatic usage ------------------- - -In order to use ``setuptools_scm`` from code that is one directory deeper -than the project's root, you can use: - -.. code:: python - - from setuptools_scm import get_version - version = get_version(root='..', relative_to=__file__) - -See `setup.py Usage`_ above for how to use this within ``setup.py``. - - -Retrieving package version at runtime -------------------------------------- - -If you have opted not to hardcode the version number inside the package, -you can retrieve it at runtime from PEP-0566_ metadata using -``importlib.metadata`` from the standard library (added in Python 3.8) -or the `importlib_metadata`_ backport: - -.. code:: python - - from importlib.metadata import version, PackageNotFoundError - - try: - __version__ = version("package-name") - except PackageNotFoundError: - # package is not installed - pass - -Alternatively, you can use ``pkg_resources`` which is included in -``setuptools``: - -.. code:: python - - from pkg_resources import get_distribution, DistributionNotFound - - try: - __version__ = get_distribution("package-name").version - except DistributionNotFound: - # package is not installed - pass - -This does place a runtime dependency on ``setuptools``. - -.. _PEP-0566: https://www.python.org/dev/peps/pep-0566/ -.. _importlib_metadata: https://pypi.org/project/importlib-metadata/ - - -Usage from Sphinx ------------------ - -It is discouraged to use ``setuptools_scm`` from Sphinx itself, -instead use ``pkg_resources`` after editable/real installation: - -.. code:: python - - # contents of docs/conf.py - from pkg_resources import get_distribution - release = get_distribution('myproject').version - # for example take major/minor - version = '.'.join(release.split('.')[:2]) - -The underlying reason is, that services like *Read the Docs* sometimes change -the working directory for good reasons and using the installed metadata -prevents using needless volatile data there. - -Notable Plugins ---------------- - -`setuptools_scm_git_archive `_ - Provides partial support for obtaining versions from git archives that - belong to tagged versions. The only reason for not including it in - ``setuptools_scm`` itself is Git/GitHub not supporting sufficient metadata - for untagged/followup commits, which is preventing a consistent UX. - - -Default versioning scheme -------------------------- - -In the standard configuration ``setuptools_scm`` takes a look at three things: - -1. latest tag (with a version number) -2. the distance to this tag (e.g. number of revisions since latest tag) -3. workdir state (e.g. uncommitted changes since latest tag) - -and uses roughly the following logic to render the version: - -no distance and clean: - ``{tag}`` -distance and clean: - ``{next_version}.dev{distance}+{scm letter}{revision hash}`` -no distance and not clean: - ``{tag}+dYYYYMMDD`` -distance and not clean: - ``{next_version}.dev{distance}+{scm letter}{revision hash}.dYYYYMMDD`` - -The next version is calculated by adding ``1`` to the last numeric component of -the tag. - - -For Git projects, the version relies on `git describe `_, -so you will see an additional ``g`` prepended to the ``{revision hash}``. - -Semantic Versioning (SemVer) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Due to the default behavior it's necessary to always include a -patch version (the ``3`` in ``1.2.3``), or else the automatic guessing -will increment the wrong part of the SemVer (e.g. tag ``2.0`` results in -``2.1.devX`` instead of ``2.0.1.devX``). So please make sure to tag -accordingly. - -.. note:: - - Future versions of ``setuptools_scm`` will switch to `SemVer - `_ by default hiding the the old behavior as an - configurable option. - - -Builtin mechanisms for obtaining version numbers ------------------------------------------------- - -1. the SCM itself (git/hg) -2. ``.hg_archival`` files (mercurial archives) -3. ``PKG-INFO`` - -.. note:: - - Git archives are not supported due to Git shortcomings - - -File finders hook makes most of MANIFEST.in unnecessary -------------------------------------------------------- - -``setuptools_scm`` implements a `file_finders -`_ -entry point which returns all files tracked by your SCM. This eliminates -the need for a manually constructed ``MANIFEST.in`` in most cases where this -would be required when not using ``setuptools_scm``, namely: - -* To ensure all relevant files are packaged when running the ``sdist`` command. - -* When using `include_package_data `_ - to include package data as part of the ``build`` or ``bdist_wheel``. - -``MANIFEST.in`` may still be used: anything defined there overrides the hook. -This is mostly useful to exclude files tracked in your SCM from packages, -although in principle it can be used to explicitly include non-tracked files -too. - - -Configuration parameters ------------------------- - -In order to configure the way ``use_scm_version`` works you can provide -a mapping with options instead of a boolean value. - -The currently supported configuration keys are: - -:root: - Relative path to cwd, used for finding the SCM root; defaults to ``.`` - -:version_scheme: - Configures how the local version number is constructed; either an - entrypoint name or a callable. - -:local_scheme: - Configures how the local component of the version is constructed; either an - entrypoint name or a callable. - -:write_to: - A path to a file that gets replaced with a file containing the current - version. It is ideal for creating a ``version.py`` file within the - package, typically used to avoid using `pkg_resources.get_distribution` - (which adds some overhead). - - .. warning:: - - Only files with :code:`.py` and :code:`.txt` extensions have builtin - templates, for other file types it is necessary to provide - :code:`write_to_template`. - -:write_to_template: - A newstyle format string that is given the current version as - the ``version`` keyword argument for formatting. - -:relative_to: - A file from which the root can be resolved. - Typically called by a script or module that is not in the root of the - repository to point ``setuptools_scm`` at the root of the repository by - supplying ``__file__``. - -:tag_regex: - A Python regex string to extract the version part from any SCM tag. - The regex needs to contain either a single match group, or a group - named ``version``, that captures the actual version information. - - Defaults to the value of ``setuptools_scm.config.DEFAULT_TAG_REGEX`` - (see `config.py `_). - -:parentdir_prefix_version: - If the normal methods for detecting the version (SCM version, - sdist metadata) fail, and the parent directory name starts with - ``parentdir_prefix_version``, then this prefix is stripped and the rest of - the parent directory name is matched with ``tag_regex`` to get a version - string. If this parameter is unset (the default), then this fallback is - not used. - - This is intended to cover GitHub's "release tarballs", which extract into - directories named ``projectname-tag/`` (in which case - ``parentdir_prefix_version`` can be set e.g. to ``projectname-``). - -:fallback_version: - A version string that will be used if no other method for detecting the - version worked (e.g., when using a tarball with no metadata). If this is - unset (the default), setuptools_scm will error if it fails to detect the - version. - -:parse: - A function that will be used instead of the discovered SCM for parsing the - version. - Use with caution, this is a function for advanced use, and you should be - familiar with the ``setuptools_scm`` internals to use it. - -:git_describe_command: - This command will be used instead the default ``git describe`` command. - Use with caution, this is a function for advanced use, and you should be - familiar with the ``setuptools_scm`` internals to use it. - - Defaults to the value set by ``setuptools_scm.git.DEFAULT_DESCRIBE`` - (see `git.py `_). - -To use ``setuptools_scm`` in other Python code you can use the ``get_version`` -function: - -.. code:: python - - from setuptools_scm import get_version - my_version = get_version() - -It optionally accepts the keys of the ``use_scm_version`` parameter as -keyword arguments. - -Example configuration in ``setup.py`` format: - -.. code:: python - - from setuptools import setup - - setup( - use_scm_version={ - 'write_to': 'version.py', - 'write_to_template': '__version__ = "{version}"', - 'tag_regex': r'^(?Pv)?(?P[^\+]+)(?P.*)?$', - } - ) - -Environment variables ---------------------- - -:SETUPTOOLS_SCM_PRETEND_VERSION: - when defined and not empty, - its used as the primary source for the version number - in which case it will be a unparsed string - - -:SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${UPPERCASED_DIST_NAME}: - when defined and not empty, - its used as the primary source for the version number - in which case it will be a unparsed string - - it takes precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION`` - - -:SETUPTOOLS_SCM_DEBUG: - when defined and not empty, - a lot of debug information will be printed as part of ``setuptools_scm`` - operating - -:SOURCE_DATE_EPOCH: - when defined, used as the timestamp from which the - ``node-and-date`` and ``node-and-timestamp`` local parts are - derived, otherwise the current time is used - (https://reproducible-builds.org/docs/source-date-epoch/) - - -:SETUPTOOLS_SCM_IGNORE_VCS_ROOTS: - when defined, a ``os.pathsep`` separated list - of directory names to ignore for root finding - -Extending setuptools_scm ------------------------- - -``setuptools_scm`` ships with a few ``setuptools`` entrypoints based hooks to -extend its default capabilities. - -Adding a new SCM -~~~~~~~~~~~~~~~~ - -``setuptools_scm`` provides two entrypoints for adding new SCMs: - -``setuptools_scm.parse_scm`` - A function used to parse the metadata of the current workdir - using the name of the control directory/file of your SCM as the - entrypoint's name. E.g. for the built-in entrypoint for git the - entrypoint is named ``.git`` and references ``setuptools_scm.git:parse`` - - The return value MUST be a ``setuptools_scm.version.ScmVersion`` instance - created by the function ``setuptools_scm.version:meta``. - -``setuptools_scm.files_command`` - Either a string containing a shell command that prints all SCM managed - files in its current working directory or a callable, that given a - pathname will return that list. - - Also use then name of your SCM control directory as name of the entrypoint. - -Version number construction -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``setuptools_scm.version_scheme`` - Configures how the version number is constructed given a - ``setuptools_scm.version.ScmVersion`` instance and should return a string - representing the version. - - Available implementations: - - :guess-next-dev: Automatically guesses the next development version (default). - Guesses the upcoming release by incrementing the pre-release segment if present, - otherwise by incrementing the micro segment. Then appends :code:`.devN`. - In case the tag ends with ``.dev0`` the version is not bumped - and custom ``.devN`` versions will trigger a error. - :post-release: generates post release versions (adds :code:`.postN`) - :python-simplified-semver: Basic semantic versioning. Guesses the upcoming release - by incrementing the minor segment and setting the micro segment to zero if the - current branch contains the string ``'feature'``, otherwise by incrementing the - micro version. Then appends :code:`.devN`. Not compatible with pre-releases. - :release-branch-semver: Semantic versioning for projects with release branches. The - same as ``guess-next-dev`` (incrementing the pre-release or micro segment) if on - a release branch: a branch whose name (ignoring namespace) parses as a version - that matches the most recent tag up to the minor segment. Otherwise if on a - non-release branch, increments the minor segment and sets the micro segment to - zero, then appends :code:`.devN`. - :no-guess-dev: Does no next version guessing, just adds :code:`.post1.devN` - -``setuptools_scm.local_scheme`` - Configures how the local part of a version is rendered given a - ``setuptools_scm.version.ScmVersion`` instance and should return a string - representing the local version. - Dates and times are in Coordinated Universal Time (UTC), because as part - of the version, they should be location independent. - - Available implementations: - - :node-and-date: adds the node on dev versions and the date on dirty - workdir (default) - :node-and-timestamp: like ``node-and-date`` but with a timestamp of - the form ``{:%Y%m%d%H%M%S}`` instead - :dirty-tag: adds ``+dirty`` if the current workdir has changes - :no-local-version: omits local version, useful e.g. because pypi does - not support it - - -Importing in ``setup.py`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -To support usage in ``setup.py`` passing a callable into ``use_scm_version`` -is supported. - -Within that callable, ``setuptools_scm`` is available for import. -The callable must return the configuration. - - -.. code:: python - - # content of setup.py - import setuptools - - def myversion(): - from setuptools_scm.version import get_local_dirty_tag - def clean_scheme(version): - return get_local_dirty_tag(version) if version.dirty else '+clean' - - return {'local_scheme': clean_scheme} - - setup( - ..., - use_scm_version=myversion, - ... - ) - - -Note on testing non-installed versions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -While the general advice is to test against a installed version, -some environments require a test prior to install, - -.. code:: - - $ python setup.py egg_info - $ PYTHONPATH=$PWD:$PWD/src pytest - - -Interaction with Enterprise Distributions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some enterprise distributions like RHEL7 and others -ship rather old setuptools versions due to various release management details. - -On such distributions one might observe errors like: - -:code:``setuptools_scm.version.SetuptoolsOutdatedWarning: your setuptools is too old (<12)`` - -In those case its typically possible to build by using a sdist against ``setuptools_scm<2.0``. -As those old setuptools versions lack sensible types for versions, -modern setuptools_scm is unable to support them sensibly. - -In case the project you need to build can not be patched to either use old setuptools_scm, -its still possible to install a more recent version of setuptools in order to handle the build -and/or install the package by using wheels or eggs. - - - - -Code of Conduct ---------------- - -Everyone interacting in the ``setuptools_scm`` project's codebases, issue -trackers, chat rooms, and mailing lists is expected to follow the -`PSF Code of Conduct`_. - -.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md - -Security Contact -================ - -To report a security vulnerability, please use the -`Tidelift security contact `_. -Tidelift will coordinate the fix and disclosure. - - diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/RECORD b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/RECORD deleted file mode 100644 index 8a6a2dbe38479981a65c31c4a5719f4c70bfdb0d..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/RECORD +++ /dev/null @@ -1,21 +0,0 @@ -setuptools_scm/__init__.py,sha256=0NWHUiWlSYqA7whMYsVAVrmnujn_NPFt-AP-9EOAIIA,5578 -setuptools_scm/__main__.py,sha256=r2weno4bqNJ3pFJCrArU2ryJOKNWZ_pg1Fz6wiEe6t0,423 -setuptools_scm/config.py,sha256=nlMUfZhtzCz40iYXOq6adW9UB8PS8TS6jPDaGECOdHs,4282 -setuptools_scm/discover.py,sha256=LqX0raq94k3llpxXmjNnDbkqECIGqEm1UcU3g2Rn2NI,416 -setuptools_scm/file_finder.py,sha256=PTYcZXz6yZAhmsCaRcVd3EPe2p_f5T6Su4RYvqpWjhU,2548 -setuptools_scm/file_finder_git.py,sha256=9KPibz5-qJG0170WpEgIhTD6NP1XkXjZyDTZaaTmL6M,2316 -setuptools_scm/file_finder_hg.py,sha256=G5-sPQjHU3Kg7LGPtAtbvsFIVmPLgSc4-9ak5Mf3E1k,1487 -setuptools_scm/git.py,sha256=p0El7RQOs3Tg68yzr-lOmm2DQNcdlW64DtaLfrdbWlk,4205 -setuptools_scm/hacks.py,sha256=KEhSSGKLaTCfQVdqAZ8JUcdL5KIZBg0K_AHiyPpCJOY,1277 -setuptools_scm/hg.py,sha256=F9gqx3S5u0m4tpOcZhGLbWBtt0qCoLdyAVQkXIIrnqE,3387 -setuptools_scm/integration.py,sha256=tJK_iTyQj-haKjohnpa5RIcxUAdQvRXgiP5vwGeNCOI,1690 -setuptools_scm/utils.py,sha256=JrpjpyzBaNP5-7uuANHJW0c7H2AJ26OLpCpkjLGcr88,3772 -setuptools_scm/version.py,sha256=RKSwD0drbqE2Fc8VF9ltGhI76M28RrtaWRPZ3EjPE10,10814 -setuptools_scm/win_py31_compat.py,sha256=w-TAp2Z21O_shi3gPvlcbxz1JZ8cGOLFd9HguCTYB6E,5098 -setuptools_scm-5.0.1.dist-info/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023 -setuptools_scm-5.0.1.dist-info/METADATA,sha256=QoFZ61ieCfZIxA_g5mJAtHKh2yHnIGaZoajm2pb9lvE,21762 -setuptools_scm-5.0.1.dist-info/WHEEL,sha256=Z-nyYpwrcSqxfdux5Mbn_DQ525iP7J2DG3JgGvOYyTQ,110 -setuptools_scm-5.0.1.dist-info/entry_points.txt,sha256=-ltXW9C7w2CaE7aerUXpZClGXQCCsm67Os_PA5oQjx4,1385 -setuptools_scm-5.0.1.dist-info/top_level.txt,sha256=kiu-91q3_rJLUoc2wl8_lC4cIlpgtgdD_4NaChF4hOA,15 -setuptools_scm-5.0.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 -setuptools_scm-5.0.1.dist-info/RECORD,, diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/WHEEL b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/WHEEL deleted file mode 100644 index 01b8fc7d4a10cb8b4f1d21f11d3398d07d6b3478..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.36.2) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/entry_points.txt b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/entry_points.txt deleted file mode 100644 index a58c5d3f3f259b6b1d1f21cc72752dd9591d1ec6..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/entry_points.txt +++ /dev/null @@ -1,36 +0,0 @@ -[distutils.setup_keywords] -use_scm_version = setuptools_scm.integration:version_keyword - -[setuptools.file_finders] -setuptools_scm = setuptools_scm.integration:find_files - -[setuptools.finalize_distribution_options] -setuptools_scm = setuptools_scm.integration:infer_version - -[setuptools_scm.files_command] -.git = setuptools_scm.file_finder_git:git_find_files -.hg = setuptools_scm.file_finder_hg:hg_find_files - -[setuptools_scm.local_scheme] -dirty-tag = setuptools_scm.version:get_local_dirty_tag -no-local-version = setuptools_scm.version:get_no_local_node -node-and-date = setuptools_scm.version:get_local_node_and_date -node-and-timestamp = setuptools_scm.version:get_local_node_and_timestamp - -[setuptools_scm.parse_scm] -.git = setuptools_scm.git:parse -.hg = setuptools_scm.hg:parse - -[setuptools_scm.parse_scm_fallback] -.hg_archival.txt = setuptools_scm.hg:parse_archival -PKG-INFO = setuptools_scm.hacks:parse_pkginfo -pip-egg-info = setuptools_scm.hacks:parse_pip_egg_info -setup.py = setuptools_scm.hacks:fallback_version - -[setuptools_scm.version_scheme] -guess-next-dev = setuptools_scm.version:guess_next_dev_version -no-guess-dev = setuptools_scm.version:no_guess_dev_version -post-release = setuptools_scm.version:postrelease_version -python-simplified-semver = setuptools_scm.version:simplified_semver_version -release-branch-semver = setuptools_scm.version:release_branch_semver_version - diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/requires.txt b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/requires.txt deleted file mode 100644 index 1fad750e491329617e7e68583af6768994e64732..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -setuptools - -[toml] -toml diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/top_level.txt b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/top_level.txt deleted file mode 100644 index cba8d8860740c8cc71720b2c8640c6b4d47ca4e2..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -setuptools_scm diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/zip-safe b/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/zip-safe deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/EGG-INFO/zip-safe +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__init__.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__init__.py deleted file mode 100644 index 47b9e44b8a5fbc5a5fd738b89ee4e21ef68f8857..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__init__.py +++ /dev/null @@ -1,188 +0,0 @@ -""" -:copyright: 2010-2015 by Ronny Pfannschmidt -:license: MIT -""" -import os -import warnings - -from .config import ( - Configuration, - DEFAULT_VERSION_SCHEME, - DEFAULT_LOCAL_SCHEME, - DEFAULT_TAG_REGEX, -) -from .utils import function_has_arg, string_types, trace -from .version import format_version, meta -from .discover import iter_matching_entrypoints - -PRETEND_KEY = "SETUPTOOLS_SCM_PRETEND_VERSION" -PRETEND_KEY_NAMED = PRETEND_KEY + "_FOR_{name}" - -TEMPLATES = { - ".py": """\ -# coding: utf-8 -# file generated by setuptools_scm -# don't change, don't track in version control -version = {version!r} -version_tuple = {version_tuple!r} -""", - ".txt": "{version}", -} - - -def version_from_scm(root): - warnings.warn( - "version_from_scm is deprecated please use get_version", - category=DeprecationWarning, - ) - config = Configuration() - config.root = root - # TODO: Is it API? - return _version_from_entrypoints(config) - - -def _call_entrypoint_fn(root, config, fn): - if function_has_arg(fn, "config"): - return fn(root, config=config) - else: - warnings.warn( - "parse functions are required to provide a named argument" - " 'config' in the future.", - category=PendingDeprecationWarning, - stacklevel=2, - ) - return fn(root) - - -def _version_from_entrypoints(config, fallback=False): - if fallback: - entrypoint = "setuptools_scm.parse_scm_fallback" - root = config.fallback_root - else: - entrypoint = "setuptools_scm.parse_scm" - root = config.absolute_root - for ep in iter_matching_entrypoints(root, entrypoint): - version = _call_entrypoint_fn(root, config, ep.load()) - - if version: - return version - - -def dump_version(root, version, write_to, template=None): - assert isinstance(version, string_types) - if not write_to: - return - target = os.path.normpath(os.path.join(root, write_to)) - ext = os.path.splitext(target)[1] - template = template or TEMPLATES.get(ext) - - if template is None: - raise ValueError( - "bad file format: '{}' (of {}) \nonly *.txt and *.py are supported".format( - os.path.splitext(target)[1], target - ) - ) - - # version_tuple: each field is converted to an int if possible or kept as string - fields = tuple(version.split(".")) - version_fields = [] - for field in fields: - try: - v = int(field) - except ValueError: - v = field - version_fields.append(v) - - with open(target, "w") as fp: - fp.write(template.format(version=version, version_tuple=tuple(version_fields))) - - -def _do_parse(config): - - trace("dist name:", config.dist_name) - if config.dist_name is not None: - pretended = os.environ.get( - PRETEND_KEY_NAMED.format(name=config.dist_name.upper()) - ) - else: - pretended = None - - if pretended is None: - pretended = os.environ.get(PRETEND_KEY) - - if pretended: - # we use meta here since the pretended version - # must adhere to the pep to begin with - return meta(tag=pretended, preformatted=True, config=config) - - if config.parse: - parse_result = _call_entrypoint_fn(config.absolute_root, config, config.parse) - if isinstance(parse_result, string_types): - raise TypeError( - "version parse result was a string\nplease return a parsed version" - ) - version = parse_result or _version_from_entrypoints(config, fallback=True) - else: - # include fallbacks after dropping them from the main entrypoint - version = _version_from_entrypoints(config) or _version_from_entrypoints( - config, fallback=True - ) - - if version: - return version - - raise LookupError( - "setuptools-scm was unable to detect version for %r.\n\n" - "Make sure you're either building from a fully intact git repository " - "or PyPI tarballs. Most other sources (such as GitHub's tarballs, a " - "git checkout without the .git folder) don't contain the necessary " - "metadata and will not work.\n\n" - "For example, if you're using pip, instead of " - "https://github.com/user/proj/archive/master.zip " - "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root - ) - - -def get_version( - root=".", - version_scheme=DEFAULT_VERSION_SCHEME, - local_scheme=DEFAULT_LOCAL_SCHEME, - write_to=None, - write_to_template=None, - relative_to=None, - tag_regex=DEFAULT_TAG_REGEX, - parentdir_prefix_version=None, - fallback_version=None, - fallback_root=".", - parse=None, - git_describe_command=None, - dist_name=None, -): - """ - If supplied, relative_to should be a file from which root may - be resolved. Typically called by a script or module that is not - in the root of the repository to direct setuptools_scm to the - root of the repository by supplying ``__file__``. - """ - - config = Configuration(**locals()) - return _get_version(config) - - -def _get_version(config): - parsed_version = _do_parse(config) - - if parsed_version: - version_string = format_version( - parsed_version, - version_scheme=config.version_scheme, - local_scheme=config.local_scheme, - ) - dump_version( - root=config.root, - version=version_string, - write_to=config.write_to, - template=config.write_to_template, - ) - - return version_string diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__main__.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__main__.py deleted file mode 100644 index a464c51a1bc9e26a1bae1132950a8e2494dde1ce..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/__main__.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import print_function -import sys -from setuptools_scm import get_version -from setuptools_scm.integration import find_files -from setuptools_scm.version import _warn_if_setuptools_outdated - - -def main(): - _warn_if_setuptools_outdated() - print("Guessed Version", get_version()) - if "ls" in sys.argv: - for fname in find_files("."): - print(fname) - - -if __name__ == "__main__": - main() diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/config.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/config.py deleted file mode 100644 index fe1eb984bfd654cbbe8c4325eb5f0dc44abb1682..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/config.py +++ /dev/null @@ -1,140 +0,0 @@ -""" configuration """ -from __future__ import print_function, unicode_literals -import os -import re -import warnings - -from .utils import trace - -DEFAULT_TAG_REGEX = r"^(?:[\w-]+-)?(?P[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$" -DEFAULT_VERSION_SCHEME = "guess-next-dev" -DEFAULT_LOCAL_SCHEME = "node-and-date" - - -def _check_tag_regex(value): - if not value: - value = DEFAULT_TAG_REGEX - regex = re.compile(value) - - group_names = regex.groupindex.keys() - if regex.groups == 0 or (regex.groups > 1 and "version" not in group_names): - warnings.warn( - "Expected tag_regex to contain a single match group or a group named" - " 'version' to identify the version part of any tag." - ) - - return regex - - -def _check_absolute_root(root, relative_to): - trace("l", repr(locals())) - if relative_to: - if os.path.isabs(root) and not root.startswith(relative_to): - warnings.warn( - "absolute root path '%s' overrides relative_to '%s'" - % (root, relative_to) - ) - if os.path.isdir(relative_to): - warnings.warn( - "relative_to is expected to be a file," - " its the directory %r\n" - "assuming the parent directory was passed" % (relative_to,) - ) - trace("dir", relative_to) - root = os.path.join(relative_to, root) - else: - trace("file", relative_to) - root = os.path.join(os.path.dirname(relative_to), root) - return os.path.abspath(root) - - -class Configuration(object): - """ Global configuration model """ - - def __init__( - self, - relative_to=None, - root=".", - version_scheme=DEFAULT_VERSION_SCHEME, - local_scheme=DEFAULT_LOCAL_SCHEME, - write_to=None, - write_to_template=None, - tag_regex=DEFAULT_TAG_REGEX, - parentdir_prefix_version=None, - fallback_version=None, - fallback_root=".", - parse=None, - git_describe_command=None, - dist_name=None, - ): - # TODO: - self._relative_to = relative_to - self._root = "." - - self.root = root - self.version_scheme = version_scheme - self.local_scheme = local_scheme - self.write_to = write_to - self.write_to_template = write_to_template - self.parentdir_prefix_version = parentdir_prefix_version - self.fallback_version = fallback_version - self.fallback_root = fallback_root - self.parse = parse - self.tag_regex = tag_regex - self.git_describe_command = git_describe_command - self.dist_name = dist_name - - @property - def fallback_root(self): - return self._fallback_root - - @fallback_root.setter - def fallback_root(self, value): - self._fallback_root = os.path.abspath(value) - - @property - def absolute_root(self): - return self._absolute_root - - @property - def relative_to(self): - return self._relative_to - - @relative_to.setter - def relative_to(self, value): - self._absolute_root = _check_absolute_root(self._root, value) - self._relative_to = value - trace("root", repr(self._absolute_root)) - trace("relative_to", repr(value)) - - @property - def root(self): - return self._root - - @root.setter - def root(self, value): - self._absolute_root = _check_absolute_root(value, self._relative_to) - self._root = value - trace("root", repr(self._absolute_root)) - trace("relative_to", repr(self._relative_to)) - - @property - def tag_regex(self): - return self._tag_regex - - @tag_regex.setter - def tag_regex(self, value): - self._tag_regex = _check_tag_regex(value) - - @classmethod - def from_file(cls, name="pyproject.toml", dist_name=None): - """ - Read Configuration from pyproject.toml (or similar). - Raises exceptions when file is not found or toml is - not installed or the file has invalid format or does - not contain the [tool.setuptools_scm] section. - """ - with open(name) as strm: - defn = __import__("toml").load(strm) - section = defn.get("tool", {})["setuptools_scm"] - return cls(dist_name=dist_name, **section) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/discover.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/discover.py deleted file mode 100644 index 019f1c5b995373decb22679312ed1154081b71d4..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/discover.py +++ /dev/null @@ -1,13 +0,0 @@ -import os -from pkg_resources import iter_entry_points -from .utils import trace - - -def iter_matching_entrypoints(path, entrypoint): - trace("looking for ep", entrypoint, path) - for ep in iter_entry_points(entrypoint): - if os.path.exists(os.path.join(path, ep.name)): - if os.path.isabs(ep.name): - trace("ignoring bad ep", ep) - trace("found ep", ep) - yield ep diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder.py deleted file mode 100644 index 5b85117925a96d39bdf12b83b58c196094394584..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -from .utils import trace - - -def scm_find_files(path, scm_files, scm_dirs): - """ setuptools compatible file finder that follows symlinks - - - path: the root directory from which to search - - scm_files: set of scm controlled files and symlinks - (including symlinks to directories) - - scm_dirs: set of scm controlled directories - (including directories containing no scm controlled files) - - scm_files and scm_dirs must be absolute with symlinks resolved (realpath), - with normalized case (normcase) - - Spec here: http://setuptools.readthedocs.io/en/latest/setuptools.html#\ - adding-support-for-revision-control-systems - """ - realpath = os.path.normcase(os.path.realpath(path)) - seen = set() - res = [] - for dirpath, dirnames, filenames in os.walk(realpath, followlinks=True): - # dirpath with symlinks resolved - realdirpath = os.path.normcase(os.path.realpath(dirpath)) - - def _link_not_in_scm(n): - fn = os.path.join(realdirpath, os.path.normcase(n)) - return os.path.islink(fn) and fn not in scm_files - - if realdirpath not in scm_dirs: - # directory not in scm, don't walk it's content - dirnames[:] = [] - continue - if os.path.islink(dirpath) and not os.path.relpath( - realdirpath, realpath - ).startswith(os.pardir): - # a symlink to a directory not outside path: - # we keep it in the result and don't walk its content - res.append(os.path.join(path, os.path.relpath(dirpath, path))) - dirnames[:] = [] - continue - if realdirpath in seen: - # symlink loop protection - dirnames[:] = [] - continue - dirnames[:] = [dn for dn in dirnames if not _link_not_in_scm(dn)] - for filename in filenames: - if _link_not_in_scm(filename): - continue - # dirpath + filename with symlinks preserved - fullfilename = os.path.join(dirpath, filename) - if os.path.normcase(os.path.realpath(fullfilename)) in scm_files: - res.append(os.path.join(path, os.path.relpath(fullfilename, realpath))) - seen.add(realdirpath) - return res - - -def is_toplevel_acceptable(toplevel): - "" - if toplevel is None: - return False - - ignored = os.environ.get("SETUPTOOLS_SCM_IGNORE_VCS_ROOTS", "").split(os.pathsep) - ignored = [os.path.normcase(p) for p in ignored] - - trace(toplevel, ignored) - - return toplevel not in ignored diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_git.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_git.py deleted file mode 100644 index 1d3e69be595c9df693cc280c1d11df4d72845b9a..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_git.py +++ /dev/null @@ -1,70 +0,0 @@ -import os -import subprocess -import tarfile -import logging -from .file_finder import scm_find_files -from .file_finder import is_toplevel_acceptable -from .utils import trace - -log = logging.getLogger(__name__) - - -def _git_toplevel(path): - try: - with open(os.devnull, "wb") as devnull: - out = subprocess.check_output( - ["git", "rev-parse", "--show-toplevel"], - cwd=(path or "."), - universal_newlines=True, - stderr=devnull, - ) - trace("find files toplevel", out) - return os.path.normcase(os.path.realpath(out.strip())) - except subprocess.CalledProcessError: - # git returned error, we are not in a git repo - return None - except OSError: - # git command not found, probably - return None - - -def _git_interpret_archive(fd, toplevel): - with tarfile.open(fileobj=fd, mode="r|*") as tf: - git_files = set() - git_dirs = {toplevel} - for member in tf.getmembers(): - name = os.path.normcase(member.name).replace("/", os.path.sep) - if member.type == tarfile.DIRTYPE: - git_dirs.add(name) - else: - git_files.add(name) - return git_files, git_dirs - - -def _git_ls_files_and_dirs(toplevel): - # use git archive instead of git ls-file to honor - # export-ignore git attribute - cmd = ["git", "archive", "--prefix", toplevel + os.path.sep, "HEAD"] - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=toplevel) - try: - try: - return _git_interpret_archive(proc.stdout, toplevel) - finally: - # ensure we avoid resource warnings by cleaning up the process - proc.stdout.close() - proc.terminate() - except Exception: - if proc.wait() != 0: - log.exception("listing git files failed - pretending there aren't any") - return (), () - - -def git_find_files(path=""): - toplevel = _git_toplevel(path) - if not is_toplevel_acceptable(toplevel): - return [] - fullpath = os.path.abspath(os.path.normpath(path)) - if not fullpath.startswith(toplevel): - trace("toplevel mismatch", toplevel, fullpath) - git_files, git_dirs = _git_ls_files_and_dirs(toplevel) - return scm_find_files(path, git_files, git_dirs) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_hg.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_hg.py deleted file mode 100644 index 816560dc9493de1c525fbecb5797201ba1545bf4..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/file_finder_hg.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import subprocess - -from .file_finder import scm_find_files -from .file_finder import is_toplevel_acceptable - - -def _hg_toplevel(path): - try: - with open(os.devnull, "wb") as devnull: - out = subprocess.check_output( - ["hg", "root"], - cwd=(path or "."), - universal_newlines=True, - stderr=devnull, - ) - return os.path.normcase(os.path.realpath(out.strip())) - except subprocess.CalledProcessError: - # hg returned error, we are not in a mercurial repo - return None - except OSError: - # hg command not found, probably - return None - - -def _hg_ls_files_and_dirs(toplevel): - hg_files = set() - hg_dirs = {toplevel} - out = subprocess.check_output( - ["hg", "files"], cwd=toplevel, universal_newlines=True - ) - for name in out.splitlines(): - name = os.path.normcase(name).replace("/", os.path.sep) - fullname = os.path.join(toplevel, name) - hg_files.add(fullname) - dirname = os.path.dirname(fullname) - while len(dirname) > len(toplevel) and dirname not in hg_dirs: - hg_dirs.add(dirname) - dirname = os.path.dirname(dirname) - return hg_files, hg_dirs - - -def hg_find_files(path=""): - toplevel = _hg_toplevel(path) - if not is_toplevel_acceptable(toplevel): - return [] - hg_files, hg_dirs = _hg_ls_files_and_dirs(toplevel) - return scm_find_files(path, hg_files, hg_dirs) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/git.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/git.py deleted file mode 100644 index a193f93d7fa45f9508f81d19d9e7c1ea2dd78bbe..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/git.py +++ /dev/null @@ -1,157 +0,0 @@ -from .config import Configuration -from .utils import do_ex, trace, require_command -from .version import meta - -from os.path import isfile, join -import warnings - - -try: - from os.path import samefile -except ImportError: - from .win_py31_compat import samefile - - -DEFAULT_DESCRIBE = "git describe --dirty --tags --long --match *[0-9]*" - - -class GitWorkdir(object): - """experimental, may change at any time""" - - def __init__(self, path): - self.path = path - - def do_ex(self, cmd): - return do_ex(cmd, cwd=self.path) - - @classmethod - def from_potential_worktree(cls, wd): - real_wd, _, ret = do_ex("git rev-parse --show-toplevel", wd) - if ret: - return - trace("real root", real_wd) - if not samefile(real_wd, wd): - return - - return cls(real_wd) - - def is_dirty(self): - out, _, _ = self.do_ex("git status --porcelain --untracked-files=no") - return bool(out) - - def get_branch(self): - branch, err, ret = self.do_ex("git rev-parse --abbrev-ref HEAD") - if ret: - trace("branch err", branch, err, ret) - return - return branch - - def is_shallow(self): - return isfile(join(self.path, ".git/shallow")) - - def fetch_shallow(self): - self.do_ex("git fetch --unshallow") - - def node(self): - rev_node, _, ret = self.do_ex("git rev-parse --verify --quiet HEAD") - if not ret: - return rev_node[:7] - - def count_all_nodes(self): - revs, _, _ = self.do_ex("git rev-list HEAD") - return revs.count("\n") + 1 - - -def warn_on_shallow(wd): - """experimental, may change at any time""" - if wd.is_shallow(): - warnings.warn('"{}" is shallow and may cause errors'.format(wd.path)) - - -def fetch_on_shallow(wd): - """experimental, may change at any time""" - if wd.is_shallow(): - warnings.warn('"%s" was shallow, git fetch was used to rectify') - wd.fetch_shallow() - - -def fail_on_shallow(wd): - """experimental, may change at any time""" - if wd.is_shallow(): - raise ValueError( - "%r is shallow, please correct with " '"git fetch --unshallow"' % wd.path - ) - - -def parse( - root, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_on_shallow, config=None -): - """ - :param pre_parse: experimental pre_parse action, may change at any time - """ - if not config: - config = Configuration(root=root) - - require_command("git") - - wd = GitWorkdir.from_potential_worktree(config.absolute_root) - if wd is None: - return - if pre_parse: - pre_parse(wd) - - if config.git_describe_command: - describe_command = config.git_describe_command - - out, unused_err, ret = wd.do_ex(describe_command) - if ret: - # If 'git git_describe_command' failed, try to get the information otherwise. - branch, branch_err, branch_ret = wd.do_ex("git symbolic-ref --short HEAD") - - if branch_ret: - branch = None - - rev_node = wd.node() - dirty = wd.is_dirty() - - if rev_node is None: - return meta("0.0", distance=0, dirty=dirty, branch=branch, config=config) - - return meta( - "0.0", - distance=wd.count_all_nodes(), - node="g" + rev_node, - dirty=dirty, - branch=wd.get_branch(), - config=config, - ) - else: - tag, number, node, dirty = _git_parse_describe(out) - - branch = wd.get_branch() - if number: - return meta( - tag, - config=config, - distance=number, - node=node, - dirty=dirty, - branch=branch, - ) - else: - return meta(tag, config=config, node=node, dirty=dirty, branch=branch) - - -def _git_parse_describe(describe_output): - # 'describe_output' looks e.g. like 'v1.5.0-0-g4060507' or - # 'v1.15.1rc1-37-g9bd1298-dirty'. - - if describe_output.endswith("-dirty"): - dirty = True - describe_output = describe_output[:-6] - else: - dirty = False - - tag, number, node = describe_output.rsplit("-", 2) - number = int(number) - return tag, number, node, dirty diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hacks.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hacks.py deleted file mode 100644 index 349d26f0bafec17149a4ce3b44c739d732dbb205..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hacks.py +++ /dev/null @@ -1,37 +0,0 @@ -import os -from .utils import data_from_mime, trace -from .version import tag_to_version, meta - - -def parse_pkginfo(root, config=None): - - pkginfo = os.path.join(root, "PKG-INFO") - trace("pkginfo", pkginfo) - data = data_from_mime(pkginfo) - version = data.get("Version") - if version != "UNKNOWN": - return meta(version, preformatted=True, config=config) - - -def parse_pip_egg_info(root, config=None): - pipdir = os.path.join(root, "pip-egg-info") - if not os.path.isdir(pipdir): - return - items = os.listdir(pipdir) - trace("pip-egg-info", pipdir, items) - if not items: - return - return parse_pkginfo(os.path.join(pipdir, items[0]), config=config) - - -def fallback_version(root, config=None): - if config.parentdir_prefix_version is not None: - _, parent_name = os.path.split(os.path.abspath(root)) - if parent_name.startswith(config.parentdir_prefix_version): - version = tag_to_version( - parent_name[len(config.parentdir_prefix_version) :], config - ) - if version is not None: - return meta(str(version), preformatted=True, config=config) - if config.fallback_version is not None: - return meta(config.fallback_version, preformatted=True, config=config) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hg.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hg.py deleted file mode 100644 index 2ac914143065a5bb0a38b1714ba04959acf22579..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/hg.py +++ /dev/null @@ -1,112 +0,0 @@ -import os -from .config import Configuration -from .utils import do, trace, data_from_mime, require_command -from .version import meta, tags_to_versions - - -def _hg_tagdist_normalize_tagcommit(config, tag, dist, node, branch): - dirty = node.endswith("+") - node = "h" + node.strip("+") - - # Detect changes since the specified tag - revset = ( - "(branch(.)" # look for revisions in this branch only - " and tag({tag!r})::." # after the last tag - # ignore commits that only modify .hgtags and nothing else: - " and (merge() or file('re:^(?!\\.hgtags).*$'))" - " and not tag({tag!r}))" # ignore the tagged commit itself - ).format(tag=tag) - if tag != "0.0": - commits = do( - ["hg", "log", "-r", revset, "--template", "{node|short}"], - config.absolute_root, - ) - else: - commits = True - trace("normalize", locals()) - if commits or dirty: - return meta( - tag, distance=dist, node=node, dirty=dirty, branch=branch, config=config - ) - else: - return meta(tag, config=config) - - -def parse(root, config=None): - if not config: - config = Configuration(root=root) - - require_command("hg") - identity_data = do("hg id -i -b -t", config.absolute_root).split() - if not identity_data: - return - node = identity_data.pop(0) - branch = identity_data.pop(0) - if "tip" in identity_data: - # tip is not a real tag - identity_data.remove("tip") - tags = tags_to_versions(identity_data) - dirty = node[-1] == "+" - if tags: - return meta(tags[0], dirty=dirty, branch=branch, config=config) - - if node.strip("+") == "0" * 12: - trace("initial node", config.absolute_root) - return meta("0.0", config=config, dirty=dirty, branch=branch) - - try: - tag = get_latest_normalizable_tag(config.absolute_root) - dist = get_graph_distance(config.absolute_root, tag) - if tag == "null": - tag = "0.0" - dist = int(dist) + 1 - return _hg_tagdist_normalize_tagcommit(config, tag, dist, node, branch) - except ValueError: - pass # unpacking failed, old hg - - -def get_latest_normalizable_tag(root): - # Gets all tags containing a '.' (see #229) from oldest to newest - cmd = [ - "hg", - "log", - "-r", - "ancestors(.) and tag('re:\\.')", - "--template", - "{tags}\n", - ] - outlines = do(cmd, root).split() - if not outlines: - return "null" - tag = outlines[-1].split()[-1] - return tag - - -def get_graph_distance(root, rev1, rev2="."): - cmd = ["hg", "log", "-q", "-r", "{}::{}".format(rev1, rev2)] - out = do(cmd, root) - return len(out.strip().splitlines()) - 1 - - -def archival_to_version(data, config=None): - trace("data", data) - node = data.get("node", "")[:12] - if node: - node = "h" + node - if "tag" in data: - return meta(data["tag"], config=config) - elif "latesttag" in data: - return meta( - data["latesttag"], - distance=data["latesttagdistance"], - node=node, - config=config, - ) - else: - return meta("0.0", node=node, config=config) - - -def parse_archival(root, config=None): - archival = os.path.join(root, ".hg_archival.txt") - data = data_from_mime(archival) - return archival_to_version(data, config=config) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/integration.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/integration.py deleted file mode 100644 index 50eb962a2bd698cc70334c4c9dff8e8721052145..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/integration.py +++ /dev/null @@ -1,61 +0,0 @@ -from pkg_resources import iter_entry_points - -from .version import _warn_if_setuptools_outdated -from .utils import do, trace_exception, trace -from . import _get_version, Configuration - - -def version_keyword(dist, keyword, value): - _warn_if_setuptools_outdated() - if not value: - return - if value is True: - value = {} - if getattr(value, "__call__", None): - value = value() - assert ( - "dist_name" not in value - ), "dist_name may not be specified in the setup keyword " - - trace( - "version keyword", - vars(dist.metadata), - ) - dist_name = dist.metadata.name - config = Configuration(dist_name=dist_name, **value) - dist.metadata.version = _get_version(config) - - -def find_files(path=""): - for ep in iter_entry_points("setuptools_scm.files_command"): - command = ep.load() - if isinstance(command, str): - # this technique is deprecated - res = do(ep.load(), path or ".").splitlines() - else: - res = command(path) - if res: - return res - return [] - - -def _args_from_toml(name="pyproject.toml"): - # todo: more sensible config initialization - # move this helper back to config and unify it with the code from get_config - - with open(name) as strm: - defn = __import__("toml").load(strm) - return defn.get("tool", {})["setuptools_scm"] - - -def infer_version(dist): - trace( - "finalize hook", - vars(dist.metadata), - ) - dist_name = dist.metadata.name - try: - config = Configuration.from_file(dist_name=dist_name) - except Exception: - return trace_exception() - dist.metadata.version = _get_version(config) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/utils.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/utils.py deleted file mode 100644 index 413e98ac10a65d9a7aa2310e5f1369fc8dcede67..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/utils.py +++ /dev/null @@ -1,151 +0,0 @@ -""" -utils -""" -from __future__ import print_function, unicode_literals -import inspect -import warnings -import sys -import shlex -import subprocess -import os -import io -import platform -import traceback - - -DEBUG = bool(os.environ.get("SETUPTOOLS_SCM_DEBUG")) -IS_WINDOWS = platform.system() == "Windows" -PY2 = sys.version_info < (3,) -PY3 = sys.version_info > (3,) -string_types = (str,) if PY3 else (str, unicode) # noqa - - -def no_git_env(env): - # adapted from pre-commit - # Too many bugs dealing with environment variables and GIT: - # https://github.com/pre-commit/pre-commit/issues/300 - # In git 2.6.3 (maybe others), git exports GIT_WORK_TREE while running - # pre-commit hooks - # In git 1.9.1 (maybe others), git exports GIT_DIR and GIT_INDEX_FILE - # while running pre-commit hooks in submodules. - # GIT_DIR: Causes git clone to clone wrong thing - # GIT_INDEX_FILE: Causes 'error invalid object ...' during commit - for k, v in env.items(): - if k.startswith("GIT_"): - trace(k, v) - return { - k: v - for k, v in env.items() - if not k.startswith("GIT_") - or k in ("GIT_EXEC_PATH", "GIT_SSH", "GIT_SSH_COMMAND") - } - - -def trace(*k): - if DEBUG: - print(*k) - sys.stdout.flush() - - -def trace_exception(): - DEBUG and traceback.print_exc() - - -def ensure_stripped_str(str_or_bytes): - if isinstance(str_or_bytes, str): - return str_or_bytes.strip() - else: - return str_or_bytes.decode("utf-8", "surrogateescape").strip() - - -def _always_strings(env_dict): - """ - On Windows and Python 2, environment dictionaries must be strings - and not unicode. - """ - if IS_WINDOWS or PY2: - env_dict.update((key, str(value)) for (key, value) in env_dict.items()) - return env_dict - - -def _popen_pipes(cmd, cwd): - return subprocess.Popen( - cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - cwd=str(cwd), - env=_always_strings( - dict( - no_git_env(os.environ), - # os.environ, - # try to disable i18n - LC_ALL="C", - LANGUAGE="", - HGPLAIN="1", - ) - ), - ) - - -def do_ex(cmd, cwd="."): - trace("cmd", repr(cmd)) - if os.name == "posix" and not isinstance(cmd, (list, tuple)): - cmd = shlex.split(cmd) - - p = _popen_pipes(cmd, cwd) - out, err = p.communicate() - if out: - trace("out", repr(out)) - if err: - trace("err", repr(err)) - if p.returncode: - trace("ret", p.returncode) - return ensure_stripped_str(out), ensure_stripped_str(err), p.returncode - - -def do(cmd, cwd="."): - out, err, ret = do_ex(cmd, cwd) - if ret: - print(err) - return out - - -def data_from_mime(path): - with io.open(path, encoding="utf-8") as fp: - content = fp.read() - trace("content", repr(content)) - # the complex conditions come from reading pseudo-mime-messages - data = dict(x.split(": ", 1) for x in content.splitlines() if ": " in x) - trace("data", data) - return data - - -def function_has_arg(fn, argname): - assert inspect.isfunction(fn) - - if PY2: - argspec = inspect.getargspec(fn).args - else: - - argspec = inspect.signature(fn).parameters - - return argname in argspec - - -def has_command(name, warn=True): - try: - p = _popen_pipes([name, "help"], ".") - except OSError: - trace(*sys.exc_info()) - res = False - else: - p.communicate() - res = not p.returncode - if not res and warn: - warnings.warn("%r was not found" % name, category=RuntimeWarning) - return res - - -def require_command(name): - if not has_command(name, warn=False): - raise EnvironmentError("%r was not found" % name) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/version.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/version.py deleted file mode 100644 index f97dca5e722f39c2bcef5cd6a775ee6b84ab6ddf..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/version.py +++ /dev/null @@ -1,378 +0,0 @@ -from __future__ import print_function -import datetime -import warnings -import re -import time -import os - -from .config import Configuration -from .utils import trace, string_types - -from pkg_resources import iter_entry_points - -from pkg_resources import parse_version as pkg_parse_version - -SEMVER_MINOR = 2 -SEMVER_PATCH = 3 -SEMVER_LEN = 3 - - -def _parse_version_tag(tag, config): - tagstring = tag if not isinstance(tag, string_types) else str(tag) - match = config.tag_regex.match(tagstring) - - result = None - if match: - if len(match.groups()) == 1: - key = 1 - else: - key = "version" - - result = { - "version": match.group(key), - "prefix": match.group(0)[: match.start(key)], - "suffix": match.group(0)[match.end(key) :], - } - - trace("tag '{}' parsed to {}".format(tag, result)) - return result - - -def _get_version_class(): - modern_version = pkg_parse_version("1.0") - if isinstance(modern_version, tuple): - return None - else: - return type(modern_version) - - -VERSION_CLASS = _get_version_class() - - -class SetuptoolsOutdatedWarning(Warning): - pass - - -# append so integrators can disable the warning -warnings.simplefilter("error", SetuptoolsOutdatedWarning, append=True) - - -def _warn_if_setuptools_outdated(): - if VERSION_CLASS is None: - warnings.warn("your setuptools is too old (<12)", SetuptoolsOutdatedWarning) - - -def callable_or_entrypoint(group, callable_or_name): - trace("ep", (group, callable_or_name)) - - if callable(callable_or_name): - return callable_or_name - - for ep in iter_entry_points(group, callable_or_name): - trace("ep found:", ep.name) - return ep.load() - - -def tag_to_version(tag, config=None): - """ - take a tag that might be prefixed with a keyword and return only the version part - :param config: optional configuration object - """ - trace("tag", tag) - - if not config: - config = Configuration() - - tagdict = _parse_version_tag(tag, config) - if not isinstance(tagdict, dict) or not tagdict.get("version", None): - warnings.warn("tag {!r} no version found".format(tag)) - return None - - version = tagdict["version"] - trace("version pre parse", version) - - if tagdict.get("suffix", ""): - warnings.warn( - "tag {!r} will be stripped of its suffix '{}'".format( - tag, tagdict["suffix"] - ) - ) - - if VERSION_CLASS is not None: - version = pkg_parse_version(version) - trace("version", repr(version)) - - return version - - -def tags_to_versions(tags, config=None): - """ - take tags that might be prefixed with a keyword and return only the version part - :param tags: an iterable of tags - :param config: optional configuration object - """ - result = [] - for tag in tags: - tag = tag_to_version(tag, config=config) - if tag: - result.append(tag) - return result - - -class ScmVersion(object): - def __init__( - self, - tag_version, - distance=None, - node=None, - dirty=False, - preformatted=False, - branch=None, - config=None, - **kw - ): - if kw: - trace("unknown args", kw) - self.tag = tag_version - if dirty and distance is None: - distance = 0 - self.distance = distance - self.node = node - self.time = datetime.datetime.utcfromtimestamp( - int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) - ) - self._extra = kw - self.dirty = dirty - self.preformatted = preformatted - self.branch = branch - self.config = config - - @property - def extra(self): - warnings.warn( - "ScmVersion.extra is deprecated and will be removed in future", - category=DeprecationWarning, - stacklevel=2, - ) - return self._extra - - @property - def exact(self): - return self.distance is None - - def __repr__(self): - return self.format_with( - "" - ) - - def format_with(self, fmt, **kw): - return fmt.format( - time=self.time, - tag=self.tag, - distance=self.distance, - node=self.node, - dirty=self.dirty, - branch=self.branch, - **kw - ) - - def format_choice(self, clean_format, dirty_format, **kw): - return self.format_with(dirty_format if self.dirty else clean_format, **kw) - - def format_next_version(self, guess_next, fmt="{guessed}.dev{distance}", **kw): - guessed = guess_next(self.tag, **kw) - return self.format_with(fmt, guessed=guessed) - - -def _parse_tag(tag, preformatted, config): - if preformatted: - return tag - if VERSION_CLASS is None or not isinstance(tag, VERSION_CLASS): - tag = tag_to_version(tag, config) - return tag - - -def meta( - tag, - distance=None, - dirty=False, - node=None, - preformatted=False, - branch=None, - config=None, - **kw -): - if not config: - warnings.warn( - "meta invoked without explicit configuration," - " will use defaults where required." - ) - parsed_version = _parse_tag(tag, preformatted, config) - trace("version", tag, "->", parsed_version) - assert parsed_version is not None, "Can't parse version %s" % tag - return ScmVersion( - parsed_version, distance, node, dirty, preformatted, branch, config, **kw - ) - - -def guess_next_version(tag_version): - version = _strip_local(str(tag_version)) - return _bump_dev(version) or _bump_regex(version) - - -def _strip_local(version_string): - public, sep, local = version_string.partition("+") - return public - - -def _bump_dev(version): - if ".dev" not in version: - return - - prefix, tail = version.rsplit(".dev", 1) - if tail != "0": - raise ValueError( - "choosing custom numbers for the `.devX` distance " - "is not supported.\n " - "The {version} can't be bumped\n" - "Please drop the tag or create a new supported one".format(version=version) - ) - return prefix - - -def _bump_regex(version): - match = re.match(r"(.*?)(\d+)$", version) - if match is None: - raise ValueError( - "{version} does not end with a number to bump, " - "please correct or use a custom version scheme".format(version=version) - ) - else: - prefix, tail = match.groups() - return "%s%d" % (prefix, int(tail) + 1) - - -def guess_next_dev_version(version): - if version.exact: - return version.format_with("{tag}") - else: - return version.format_next_version(guess_next_version) - - -def guess_next_simple_semver(version, retain, increment=True): - try: - parts = [int(i) for i in str(version).split(".")[:retain]] - except ValueError: - raise ValueError( - "{version} can't be parsed as numeric version".format(version=version) - ) - while len(parts) < retain: - parts.append(0) - if increment: - parts[-1] += 1 - while len(parts) < SEMVER_LEN: - parts.append(0) - return ".".join(str(i) for i in parts) - - -def simplified_semver_version(version): - if version.exact: - return guess_next_simple_semver(version.tag, retain=SEMVER_LEN, increment=False) - else: - if version.branch is not None and "feature" in version.branch: - return version.format_next_version( - guess_next_simple_semver, retain=SEMVER_MINOR - ) - else: - return version.format_next_version( - guess_next_simple_semver, retain=SEMVER_PATCH - ) - - -def release_branch_semver_version(version): - if version.exact: - return version.format_with("{tag}") - if version.branch is not None: - # Does the branch name (stripped of namespace) parse as a version? - branch_ver = _parse_version_tag(version.branch.split("/")[-1], version.config) - if branch_ver is not None: - # Does the branch version up to the minor part match the tag? If not it - # might be like, an issue number or something and not a version number, so - # we only want to use it if it matches. - tag_ver_up_to_minor = str(version.tag).split(".")[:SEMVER_MINOR] - branch_ver_up_to_minor = branch_ver["version"].split(".")[:SEMVER_MINOR] - if branch_ver_up_to_minor == tag_ver_up_to_minor: - # We're in a release/maintenance branch, next is a patch/rc/beta bump: - return version.format_next_version(guess_next_version) - # We're in a development branch, next is a minor bump: - return version.format_next_version(guess_next_simple_semver, retain=SEMVER_MINOR) - - -def release_branch_semver(version): - warnings.warn( - "release_branch_semver is deprecated and will be removed in future. " - + "Use release_branch_semver_version instead", - category=DeprecationWarning, - stacklevel=2, - ) - return release_branch_semver_version(version) - - -def no_guess_dev_version(version): - if version.exact: - return version.format_with("{tag}") - else: - return version.format_with("{tag}.post1.dev{distance}") - - -def _format_local_with_time(version, time_format): - - if version.exact or version.node is None: - return version.format_choice( - "", "+d{time:{time_format}}", time_format=time_format - ) - else: - return version.format_choice( - "+{node}", "+{node}.d{time:{time_format}}", time_format=time_format - ) - - -def get_local_node_and_date(version): - return _format_local_with_time(version, time_format="%Y%m%d") - - -def get_local_node_and_timestamp(version, fmt="%Y%m%d%H%M%S"): - return _format_local_with_time(version, time_format=fmt) - - -def get_local_dirty_tag(version): - return version.format_choice("", "+dirty") - - -def get_no_local_node(_): - return "" - - -def postrelease_version(version): - if version.exact: - return version.format_with("{tag}") - else: - return version.format_with("{tag}.post{distance}") - - -def format_version(version, **config): - trace("scm version", version) - trace("config", config) - if version.preformatted: - return version.tag - version_scheme = callable_or_entrypoint( - "setuptools_scm.version_scheme", config["version_scheme"] - ) - local_scheme = callable_or_entrypoint( - "setuptools_scm.local_scheme", config["local_scheme"] - ) - main_version = version_scheme(version) - trace("version", main_version) - local_version = local_scheme(version) - trace("local_version", local_version) - return version_scheme(version) + local_scheme(version) diff --git a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/win_py31_compat.py b/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/win_py31_compat.py deleted file mode 100644 index 82a11eb42edae70a110dd58d4cb1837f96a22100..0000000000000000000000000000000000000000 --- a/.eggs/setuptools_scm-5.0.1-py3.7.egg/setuptools_scm/win_py31_compat.py +++ /dev/null @@ -1,214 +0,0 @@ -""" -Backport of os.path.samefile for Python prior to 3.2 -on Windows from jaraco.windows 3.8. - -DON'T EDIT THIS FILE! - -Instead, file tickets and PR's with `jaraco.windows -`_ and request -a port to setuptools_scm. -""" - -import os -import nt -import posixpath -import ctypes.wintypes -import sys -import __builtin__ as builtins - - -## -# From jaraco.windows.error - -def format_system_message(errno): - """ - Call FormatMessage with a system error number to retrieve - the descriptive error message. - """ - # first some flags used by FormatMessageW - ALLOCATE_BUFFER = 0x100 - FROM_SYSTEM = 0x1000 - - # Let FormatMessageW allocate the buffer (we'll free it below) - # Also, let it know we want a system error message. - flags = ALLOCATE_BUFFER | FROM_SYSTEM - source = None - message_id = errno - language_id = 0 - result_buffer = ctypes.wintypes.LPWSTR() - buffer_size = 0 - arguments = None - bytes = ctypes.windll.kernel32.FormatMessageW( - flags, - source, - message_id, - language_id, - ctypes.byref(result_buffer), - buffer_size, - arguments, - ) - # note the following will cause an infinite loop if GetLastError - # repeatedly returns an error that cannot be formatted, although - # this should not happen. - handle_nonzero_success(bytes) - message = result_buffer.value - ctypes.windll.kernel32.LocalFree(result_buffer) - return message - - -class WindowsError(builtins.WindowsError): - """ - More info about errors at - http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx - """ - - def __init__(self, value=None): - if value is None: - value = ctypes.windll.kernel32.GetLastError() - strerror = format_system_message(value) - if sys.version_info > (3, 3): - args = 0, strerror, None, value - else: - args = value, strerror - super(WindowsError, self).__init__(*args) - - @property - def message(self): - return self.strerror - - @property - def code(self): - return self.winerror - - def __str__(self): - return self.message - - def __repr__(self): - return '{self.__class__.__name__}({self.winerror})'.format(**vars()) - - -def handle_nonzero_success(result): - if result == 0: - raise WindowsError() - - -## -# From jaraco.windows.api.filesystem - -FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 -FILE_FLAG_BACKUP_SEMANTICS = 0x2000000 -OPEN_EXISTING = 3 -FILE_ATTRIBUTE_NORMAL = 0x80 -FILE_READ_ATTRIBUTES = 0x80 -INVALID_HANDLE_VALUE = ctypes.wintypes.HANDLE(-1).value - - -class BY_HANDLE_FILE_INFORMATION(ctypes.Structure): - _fields_ = [ - ('file_attributes', ctypes.wintypes.DWORD), - ('creation_time', ctypes.wintypes.FILETIME), - ('last_access_time', ctypes.wintypes.FILETIME), - ('last_write_time', ctypes.wintypes.FILETIME), - ('volume_serial_number', ctypes.wintypes.DWORD), - ('file_size_high', ctypes.wintypes.DWORD), - ('file_size_low', ctypes.wintypes.DWORD), - ('number_of_links', ctypes.wintypes.DWORD), - ('file_index_high', ctypes.wintypes.DWORD), - ('file_index_low', ctypes.wintypes.DWORD), - ] - - @property - def file_size(self): - return (self.file_size_high << 32) + self.file_size_low - - @property - def file_index(self): - return (self.file_index_high << 32) + self.file_index_low - - -class SECURITY_ATTRIBUTES(ctypes.Structure): - _fields_ = ( - ('length', ctypes.wintypes.DWORD), - ('p_security_descriptor', ctypes.wintypes.LPVOID), - ('inherit_handle', ctypes.wintypes.BOOLEAN), - ) - - -LPSECURITY_ATTRIBUTES = ctypes.POINTER(SECURITY_ATTRIBUTES) - - -CreateFile = ctypes.windll.kernel32.CreateFileW -CreateFile.argtypes = ( - ctypes.wintypes.LPWSTR, - ctypes.wintypes.DWORD, - ctypes.wintypes.DWORD, - LPSECURITY_ATTRIBUTES, - ctypes.wintypes.DWORD, - ctypes.wintypes.DWORD, - ctypes.wintypes.HANDLE, -) -CreateFile.restype = ctypes.wintypes.HANDLE - -GetFileInformationByHandle = ctypes.windll.kernel32.GetFileInformationByHandle -GetFileInformationByHandle.restype = ctypes.wintypes.BOOL -GetFileInformationByHandle.argtypes = ( - ctypes.wintypes.HANDLE, - ctypes.POINTER(BY_HANDLE_FILE_INFORMATION), -) - - -## -# From jaraco.windows.filesystem - -def compat_stat(path): - """ - Generate stat as found on Python 3.2 and later. - """ - stat = os.stat(path) - info = get_file_info(path) - # rewrite st_ino, st_dev, and st_nlink based on file info - return nt.stat_result( - (stat.st_mode,) + - (info.file_index, info.volume_serial_number, info.number_of_links) + - stat[4:] - ) - - -def samefile(f1, f2): - """ - Backport of samefile from Python 3.2 with support for Windows. - """ - return posixpath.samestat(compat_stat(f1), compat_stat(f2)) - - -def get_file_info(path): - # open the file the same way CPython does in posixmodule.c - desired_access = FILE_READ_ATTRIBUTES - share_mode = 0 - security_attributes = None - creation_disposition = OPEN_EXISTING - flags_and_attributes = ( - FILE_ATTRIBUTE_NORMAL | - FILE_FLAG_BACKUP_SEMANTICS | - FILE_FLAG_OPEN_REPARSE_POINT - ) - template_file = None - - handle = CreateFile( - path, - desired_access, - share_mode, - security_attributes, - creation_disposition, - flags_and_attributes, - template_file, - ) - - if handle == INVALID_HANDLE_VALUE: - raise WindowsError() - - info = BY_HANDLE_FILE_INFORMATION() - res = GetFileInformationByHandle(handle, info) - handle_nonzero_success(res) - - return info diff --git a/.gitignore b/.gitignore index 4b84defd1eca7aa79d1bd688e82db8176d25b295..4c3caed7ed66e8310d0ee4c0992fd312508df05d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ test_reports.xml # Python egg metadata, regenerated from source files by setuptools. **/*.egg-info **/*.rdb +**/.eggs +**/_version.py \ No newline at end of file diff --git a/csst_dfs_api_local/_version.py b/csst_dfs_api_local/_version.py deleted file mode 100644 index 9dcb07652769ac1376c38648fcea07b5254a2a30..0000000000000000000000000000000000000000 --- a/csst_dfs_api_local/_version.py +++ /dev/null @@ -1,5 +0,0 @@ -# coding: utf-8 -# file generated by setuptools_scm -# don't change, don't track in version control -version = '0.1.dev1+gd5fcbad.d20210224' -version_tuple = (0, 1, 'dev1+gd5fcbad', 'd20210224')