Skip to content

Commit

Permalink
Update package metadata (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Apr 17, 2022
1 parent 49da4e5 commit d6ab2ca
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 77 deletions.
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -39,11 +39,6 @@ repos:
hooks:
- id: tox-ini-fmt
args: [ "-p", "fix" ]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
Expand Down
70 changes: 59 additions & 11 deletions pyproject.toml
@@ -1,19 +1,67 @@
[build-system]
requires = ["setuptools >= 44", "wheel >= 0.30", "setuptools_scm[toml]>=5"]
build-backend = "setuptools.build_meta"
build-backend = "hatchling.build"
requires = ["hatchling>=0.22.0", "hatch-vcs"]

[project]
name = "platformdirs"
description = 'A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".'
readme = "README.rst"
license = "MIT"
maintainers = [
{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
{ name = "Julian Berman", email = "Julian@GrayVines.com" },
{ name = "Ofek Lev", email = "oss@ofek.dev" },
{ name = "Ronny Pfannschmidt", email = "opensource@ronnypfannschmidt.de" },
]
urls.Documentation = "https://platformdirs.readthedocs.io"
urls.Homepage = "https://github.com/platformdirs/platformdirs"
urls.Source = "https://github.com/platformdirs/platformdirs"
urls.Tracker = "https://github.com/platformdirs/platformdirs/issues"
requires-python = ">=3.7"
optional-dependencies.test = [
"appdirs==1.4.4",
"pytest>=6",
"pytest-cov>=2.7",
"pytest-mock>=3.6",
]
optional-dependencies.docs = [
"furo>=2021.7.5b38",
"proselint>=0.10.2",
"sphinx>=4",
"sphinx-autodoc-typehints>=1.12",
]
keywords = ["application", "cache", "directory", "log", "user"]
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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = ["version"]

[tool.hatch]
build.hooks.vcs.template = '''
"""Version information"""
__version__ = "{version}"
__version_info__ = {version_tuple}
'''
build.hooks.vcs.version-file = "src/platformdirs/version.py"
version.source = "vcs"

[tool.black]
line-length = 120

[tool.isort]
profile = "black"
known_first_party = ["platformdirs"]

[tool.setuptools_scm]
write_to = "src/platformdirs/version.py"
write_to_template = """
\"\"\" Version information \"\"\"
__version__ = "{version}"
__version_info__ = {version_tuple}
"""
56 changes: 0 additions & 56 deletions setup.cfg
@@ -1,59 +1,3 @@
[metadata]
name = platformdirs
description = A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/platformdirs/platformdirs
maintainer = Bernát Gábor, Julian Berman, Ofek Lev, Ronny Pfannschmidt
maintainer_email = gaborjbernat@gmail.com, Julian@GrayVines.com, oss@ofek.dev, opensource@ronnypfannschmidt.de
license = MIT
license_file = LICENSE.txt
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 :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Software Development :: Libraries :: Python Modules
keywords = application directory log cache user
project_urls =
Source=https://github.com/platformdirs/platformdirs
Tracker=https://github.com/platformdirs/platformdirs/issues
Documentation=https://platformdirs.readthedocs.io/

[options]
packages = find:
python_requires = >=3.7
package_dir =
=src
zip_safe = True

[options.packages.find]
where = src

[options.extras_require]
docs =
Sphinx>=4
furo>=2021.7.5b38
proselint>=0.10.2
sphinx-autodoc-typehints>=1.12
test =
appdirs==1.4.4
pytest>=6
pytest-cov>=2.7
pytest-mock>=3.6

[options.package_data]
platformdirs = py.typed

[flake8]
max-line-length = 120
dictionaries = en_US,python,technical
Expand Down
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

10 comments on commit d6ab2ca

@TimB87
Copy link

@TimB87 TimB87 commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

how am I supposed to build this?

@ofek
Copy link
Contributor Author

@ofek ofek commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

In what context?

@TimB87
Copy link

@TimB87 TimB87 commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

As a port maintainer. I guess it needs hatch not "just" hatchling..?

Current port using setuptools

@ofek
Copy link
Contributor Author

@ofek ofek commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

only needs hatchling

@TimB87
Copy link

@TimB87 TimB87 commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

So, what do I do with it? python -m hatchling build threw an error for me and I gave up.

+ /usr/bin/python3 -m hatchling build
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.9/site-packages/hatchling/__main__.py", line 6, in <module>
    sys.exit(hatchling())
  File "/usr/lib/python3.9/site-packages/hatchling/cli/__init__.py", line 24, in hatchling
    command(**kwargs)
  File "/usr/lib/python3.9/site-packages/hatchling/cli/build/__init__.py", line 70, in build_impl
    for artifact in builder.build(
  File "/usr/lib/python3.9/site-packages/hatchling/builders/plugin/interface.py", line 103, in build
    configured_build_hooks = self.get_build_hooks(directory)
  File "/usr/lib/python3.9/site-packages/hatchling/builders/plugin/interface.py", line 318, in get_build_hooks
    raise ValueError('Unknown build hook: {}'.format(hook_name))
ValueError: Unknown build hook: vcs
[sdist]

@ofek
Copy link
Contributor Author

@ofek ofek commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

specifically: requires = ["hatchling>=0.22.0", "hatch-vcs"]

@gaborbernat
Copy link
Contributor

Choose a reason for hiding this comment

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

You're not supposed to build the wheel yourself. You're supposed to use a wheel builder, such as https://pypi.org/project/build/, which would pull the build dependencies as defined in the pyproject.toml - https://github.com/platformdirs/platformdirs/blob/main/pyproject.toml#L3 👍 as defined by the new 6 years old standard https://peps.python.org/pep-0518/

@TimB87
Copy link

@TimB87 TimB87 commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

@gaborbernat Okay, so I can keep using build, thats nice..

@ofek I am using 0.22.0 though.
The error stays the same when using build.

@ofek
Copy link
Contributor Author

@ofek ofek commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

you'll need both things I listed

@TimB87
Copy link

@TimB87 TimB87 commented on d6ab2ca Apr 18, 2022

Choose a reason for hiding this comment

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

Gotcha.. thanks.

Please sign in to comment.