From nobody Tue Mar 21 19:28:31 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ph1qM377Jz40j2H; Tue, 21 Mar 2023 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ph1qM25Z0z4R29; Tue, 21 Mar 2023 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679426911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M90U6fq9A4wFb5J0mc6hOgit3570Ofcug3O5PuL0hyI=; b=Qv/HwkwOpwqunN4zG5Di2UfX5Cmw5/MkJqSRA6lTdOE7Q9M0akCpxSn5mJLfbjjZjbVUQM FaRLLOmlhRt5rVAMu9XdLk2XzYRugT4gshKk0Dgnd4bAPqnLkn/ktGRabiaYA3Gq3/wmE0 wXpg9GmZpAl7yIp57jj4J84AVvHaxdMjIWniZzVG9lkUPy+dZJU9rsBXrehhdUSAWATns8 jN/Tf/BvC+psmPm7v2FywBgtICzfzOyD2DeVRuC922aKHNwCo/sAULcb1io+ogedmkewM9 9AAF4f3/hoHf7dXFOG6SY1Tttm66QfMHq+HUB6gGotHtFNFaBRu5Aoyoi7+P9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679426911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M90U6fq9A4wFb5J0mc6hOgit3570Ofcug3O5PuL0hyI=; b=FFDCqjfN0+PamXDafNXriwctJFpxx9u77CAP/r4VxQsY8kZm/YZFzgutNsrYNwmWYeKdGY +I5SUsYfT8IXac4lh/Ou/gRDuZEoOFgSmAYdDwvAOT1VP8PSOfRsGx2wPHryUv4Q81ycOt iOT1de1WhvyAy+mQDD7tyFPcAV74qaKuE5tapgemX3394VKWGOD3j6pBM2P5SdCYcJ4PgU dfAD2vNtEK51UocLWLWGuJfJf26oATmnHATk9do9GCLimNj6ShoZwpPtb+2w+MWe2Yl/Rs zLde6JuuWK0E6VE1pS93zvTvc8PuWQXvdJJnaLHXV6U3mgJHicWUduliUHv8uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679426911; a=rsa-sha256; cv=none; b=upfQrUJIxfG82wjkQM5jc9p30O9SDN+9m8FAqtdmCtF7srpJu1c1YjvwIu9zl7y81aW2kw KmV+cR25OdAnTWoEBboPXP0+pFSOQ9GCSftHuEFSoswHbyImOHlVkkfOLKxQ90ViqLxYgB vNDj4VGz4TZf0E6v4twiZ4EYV9+wngqcT/gShaKswVblDEbs+iuWCLFtb7i9gKwZwGuFJM YHIE2tzDPKQajcvLk/qE8dZFb414O6NDvTwop3D86j1BnjH/ajY5+m/MN6OUBX4Bpxve09 dpRtRSstPMc/rpf3+tEzTk5GYi0j3h/VBgWdOLgG6ThyzrZcQ1rqvFy9BYxNjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ph1qM14v9zPdg; Tue, 21 Mar 2023 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32LJSVmS032141; Tue, 21 Mar 2023 19:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32LJSV27032140; Tue, 21 Mar 2023 19:28:31 GMT (envelope-from git) Date: Tue, 21 Mar 2023 19:28:31 GMT Message-Id: <202303211928.32LJSV27032140@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 14b707da3316 - main - devel/py-platformdirs: Convert to USE_PYTHON=pep517 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14b707da3316766d1fef634cb726ddded945c359 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=14b707da3316766d1fef634cb726ddded945c359 commit 14b707da3316766d1fef634cb726ddded945c359 Author: Po-Chuan Hsieh AuthorDate: 2023-03-21 18:45:03 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-03-21 19:20:56 +0000 devel/py-platformdirs: Convert to USE_PYTHON=pep517 - Bump PORTREVISION for dependency and package change --- devel/py-platformdirs/Makefile | 9 ++-- .../files/patch-src-platformdirs-__init__.py | 28 +++++++++++++ devel/py-platformdirs/files/setup.py | 49 ---------------------- 3 files changed, 34 insertions(+), 52 deletions(-) diff --git a/devel/py-platformdirs/Makefile b/devel/py-platformdirs/Makefile index 69177d9a4b97..e651ed3f54c6 100644 --- a/devel/py-platformdirs/Makefile +++ b/devel/py-platformdirs/Makefile @@ -1,5 +1,6 @@ PORTNAME= platformdirs PORTVERSION= 2.6.2 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,8 +12,11 @@ WWW= https://github.com/platformdirs/platformdirs LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>=1.11.1:devel/py-hatchling@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}hatch-vcs>=0.3:devel/py-hatch-vcs@${PY_FLAVOR} + USES= python:3.7+ -USE_PYTHON= autoplist concurrent distutils +USE_PYTHON= autoplist concurrent pep517 NO_ARCH= yes @@ -23,7 +27,6 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.4:devel/py-typing-exte .endif post-patch: - @${RM} ${WRKSRC}/pyproject.toml - @${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py + @${RM} ${WRKSRC}/src/platformdirs/__init__.py.orig .include diff --git a/devel/py-platformdirs/files/patch-src-platformdirs-__init__.py b/devel/py-platformdirs/files/patch-src-platformdirs-__init__.py new file mode 100644 index 000000000000..5a8a176b0954 --- /dev/null +++ b/devel/py-platformdirs/files/patch-src-platformdirs-__init__.py @@ -0,0 +1,28 @@ +Workaround for setuptools-scm 6.x + +>>> import platformdirs +Traceback (most recent call last): + File "", line 1, in + File "/usr/local/lib/python3.9/site-packages/platformdirs/__init__.py", line 17, in + from .version import __version__ +ImportError: cannot import name '__version__' from 'platformdirs.version' (/usr/local/lib/python3.9/site-packages/platformdirs/version.py) + +Reference: https://github.com/pypa/setuptools_scm/commit/b45e19f9f275a31873fd5e07faabef16fd0bbec0 + +--- src/platformdirs/__init__.py.orig 2020-02-02 00:00:00 UTC ++++ src/platformdirs/__init__.py +@@ -14,8 +14,12 @@ else: # pragma: no cover (py38+) + from typing_extensions import Literal + + from .api import PlatformDirsABC +-from .version import __version__ +-from .version import __version_tuple__ as __version_info__ ++try: ++ from .version import __version__ ++ from .version import __version_tuple__ as __version_info__ ++except: ++ from .version import version ++ from .version import version_tuple as __version_info__ + + + def _set_platform_dir_class() -> type[PlatformDirsABC]: diff --git a/devel/py-platformdirs/files/setup.py b/devel/py-platformdirs/files/setup.py deleted file mode 100644 index f6f33e2d931e..000000000000 --- a/devel/py-platformdirs/files/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -from setuptools import setup - -setup( - name='platformdirs', - version='%%PORTVERSION%%', - description='A small Python package for determining appropriate platform-specific dirs, e.g. a "user data dir".', - long_description='The problem\n===========\n\n.. image:: https://github.com/platformdirs/platformdirs/workflows/Test/badge.svg\n :target: https://github.com/platformdirs/platformdirs/actions?query=workflow%3ATest\n\nWhen writing desktop application, finding the right location to store user data\nand configuration varies per platform. Even for single-platform apps, there\nmay by plenty of nuances in figuring out the right location.\n\nFor example, if running on macOS, you should use::\n\n ~/Library/Application Support/\n\nIf on Windows (at least English Win XP) that should be::\n\n C:\\Documents and Settings\\\\Application Data\\Local Settings\\\\\n\nor possibly::\n\n C:\\Documents and Settings\\\\Application Data\\\\\n\nfor `roaming profiles `_ but that is another story.\n\nOn Linux (and other Unices), accordin g to the `XDG Basedir Spec`_, it should be::\n\n ~/.local/share/\n\n.. _XDG Basedir Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html\n\n``platformdirs`` to the rescue\n==============================\n\nThis kind of thing is what the ``platformdirs`` package is for.\n``platformdirs`` will help you choose an appropriate:\n\n- user data dir (``user_data_dir``)\n- user config dir (``user_config_dir``)\n- user cache dir (``user_cache_dir``)\n- site data dir (``site_data_dir``)\n- site config dir (``site_config_dir``)\n- user log dir (``user_log_dir``)\n- user documents dir (``user_documents_dir``)\n- user runtime dir (``user_runtime_dir``)\n\nAnd also:\n\n- Is slightly opinionated on the directory names used. Look for "OPINION" in\n documentation and code for when an opinion is being applied.\n\nExample output\n==============\n\nOn macOS:\n\n.. code-block:: pycon\n\n >>> from platformdirs import *\n >>> appname = "SuperApp"\n >>> ap pauthor = "Acme"\n >>> user_data_dir(appn! ame, appauthor)\n \'/Users/trentm/Library/Application Support/SuperApp\'\n >>> site_data_dir(appname, appauthor)\n \'/Library/Application Support/SuperApp\'\n >>> user_cache_dir(appname, appauthor)\n \'/Users/trentm/Library/Caches/SuperApp\'\n >>> user_log_dir(appname, appauthor)\n \'/Users/trentm/Library/Logs/SuperApp\'\n >>> user_documents_dir()\n \'/Users/trentm/Documents\'\n >>> user_runtime_dir(appname, appauthor)\n \'/Users/trentm/Library/Caches/TemporaryItems/SuperApp\'\n\nOn Windows 7:\n\n.. code-block:: pycon\n\n >>> from platformdirs import *\n >>> appname = "SuperApp"\n >>> appauthor = "Acme"\n >>> user_data_dir(appname, appauthor)\n \'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme\\\\SuperApp\'\n >>> user_data_dir(appname, appauthor, roaming=True)\n \'C:\\\\Users\\\\trentm\\\\AppData\\\\Roaming\\\\Acme\\\\SuperApp\'\n >>> user_cache_dir(appname, appauthor)\n \'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme \\\\SuperApp\\\\Cache\'\n >>> user_log_dir(appname, appauthor)\n \'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Acme\\\\SuperApp\\\\Logs\'\n >>> user_documents_dir()\n \'C:\\\\Users\\\\trentm\\\\Documents\'\n >>> user_runtime_dir(appname, appauthor)\n \'C:\\\\Users\\\\trentm\\\\AppData\\\\Local\\\\Temp\\\\Acme\\\\SuperApp\'\n\nOn Linux:\n\n.. code-block:: pycon\n\n >>> from platformdirs import *\n >>> appname = "SuperApp"\n >>> appauthor = "Acme"\n >>> user_data_dir(appname, appauthor)\n \'/home/trentm/.local/share/SuperApp\'\n >>> site_data_dir(appname, appauthor)\n \'/usr/local/share/SuperApp\'\n >>> site_data_dir(appname, appauthor, multipath=True)\n \'/usr/local/share/SuperApp:/usr/share/SuperApp\'\n >>> user_cache_dir(appname, appauthor)\n \'/home/trentm/.cache/SuperApp\'\n >>> user_log_dir(appname, appauthor)\n \'/home/trentm/.cache/SuperApp/log\'\n >>> user_config_dir(appname)\n \'/home/trentm/.config/SuperApp\'\n >>> user_documents_dir()\n \'/home/tr! entm/Docu! ments\'\n >>> user_runtime_dir(appname, appauthor)\n \'/run/user/{os.getuid()}/SuperApp\'\n >>> site_config_dir(appname)\n \'/etc/xdg/SuperApp\'\n >>> os.environ["XDG_CONFIG_DIRS"] = "/etc:/usr/local/etc"\n >>> site_config_dir(appname, multipath=True)\n \'/etc/SuperApp:/usr/local/etc/SuperApp\'\n\nOn Android::\n\n >>> from platformdirs import *\n >>> appname = "SuperApp"\n >>> appauthor = "Acme"\n >>> user_data_dir(appname, appauthor)\n \'/data/data/com.myApp/files/SuperApp\'\n >>> user_cache_dir(appname, appauthor)\n \'/data/data/com.myApp/cache/SuperApp\'\n >>> user_log_dir(appname, appauthor)\n \'/data/data/com.myApp/cache/SuperApp/log\'\n >>> user_config_dir(appname)\n \'/data/data/com.myApp/shared_prefs/SuperApp\'\n >>> user_documents_dir()\n \'/storage/emulated/0/Documents\'\n >>> user_runtime_dir(appname, appauthor)\n \'/data/data/com.myApp/cache/SuperApp/tmp\'\n\nNote: Some android apps like Termux and Pydroid are used as shells. These\napps are used by the end user to emulate Linux environment. Presence of\n``SHELL`` environment variable is used by Platformdirs to differentiate\nbetween general android apps and android apps used as shells. Shell android\napps also support ``XDG_*`` environment variables.\n\n\n``PlatformDirs`` for convenience\n================================\n\n.. code-block:: pycon\n\n >>> from platformdirs import PlatformDirs\n >>> dirs = PlatformDirs("SuperApp", "Acme")\n >>> dirs.user_data_dir\n \'/Users/trentm/Library/Application Support/SuperApp\'\n >>> dirs.site_data_dir\n \'/Library/Application Support/SuperApp\'\n >>> dirs.user_cache_dir\n \'/Users/trentm/Library/Caches/SuperApp\'\n >>> dirs.user_log_dir\n \'/Users/trentm/Library/Logs/SuperApp\'\n >>> dirs.user_documents_dir\n \'/Users/trentm/Documents\'\n >>> dirs.user_runtime_dir\n \'/Users/trentm/Library/Caches/TemporaryItems/SuperApp\'\n\nPer-version isolation\n==== =================\n\nIf you have multiple ve! rsions of! your app in use that you want to be\nable to run side-by-side, then you may want version-isolation for these\ndirs::\n\n >>> from platformdirs import PlatformDirs\n >>> dirs = PlatformDirs("SuperApp", "Acme", version="1.0")\n >>> dirs.user_data_dir\n \'/Users/trentm/Library/Application Support/SuperApp/1.0\'\n >>> dirs.site_data_dir\n \'/Library/Application Support/SuperApp/1.0\'\n >>> dirs.user_cache_dir\n \'/Users/trentm/Library/Caches/SuperApp/1.0\'\n >>> dirs.user_log_dir\n \'/Users/trentm/Library/Logs/SuperApp/1.0\'\n >>> dirs.user_documents_dir\n \'/Users/trentm/Documents\'\n >>> dirs.user_runtime_dir\n \'/Users/trentm/Library/Caches/TemporaryItems/SuperApp/1.0\'\n\nBe wary of using this for configuration files though; you\'ll need to handle\nmigrating configuration files manually.\n\nWhy this Fork?\n==============\n\nThis repository is a friendly fork of the wonderful work started by\n`ActiveState `_ who created\n``appdirs``, this package\'s ancestor.\n\nMaintaining an open source project is no easy task, particularly\nfrom within an organization, and the Python community is indebted\nto ``appdirs`` (and to Trent Mick and Jeff Rouse in particular) for\ncreating an incredibly useful simple module, as evidenced by the wide\nnumber of users it has attracted over the years.\n\nNonetheless, given the number of long-standing open issues\nand pull requests, and no clear path towards `ensuring\nthat maintenance of the package would continue or grow\n`_, this fork was\ncreated.\n\nContributions are most welcome.\n', - maintainer_email='Bernát Gábor , Julian Berman , Ofek Lev , Ronny Pfannschmidt ', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - install_requires=[ - 'typing-extensions>=4.4; python_version < "3.8"', - ], - extras_require={ - 'docs': [ - 'furo>=2022.12.7', - 'proselint>=0.13', - 'sphinx-autodoc-typehints>=1.19.5', - 'sphinx>=5.3', - ], - 'test': [ - 'appdirs==1.4.4', - 'covdefaults>=2.2.2', - 'pytest-cov>=4', - 'pytest-mock>=3.10', - 'pytest>=7.2', - ], - }, - packages=[ - 'platformdirs', - ], - package_dir={'': 'src'}, -)