Skip to content

Commit

Permalink
✨ use OZI.build 1.4
Browse files Browse the repository at this point in the history
moves all metadata into project and tool.ozi-build

Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Aug 29, 2024
1 parent c223d71 commit ff8aa92
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 67 deletions.
29 changes: 5 additions & 24 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ project(
'''from setuptools_scm import get_version
from packaging.version import Version
v = get_version(normalize=False)
if Version(v) < Version("0.1"):
print("0.6")
else:
print(v)
print(v)
''',
],
check: true,
Expand Down Expand Up @@ -186,22 +183,10 @@ else
pip_compile = find_program('pip-compile', required: true).full_path()
endif
if not meson.is_subproject()
custom_target(
'requirements.txt',
input: root_files[3],
output: 'requirements.txt',
build_always_stale: true,
build_by_default: true,
command: [
pip_compile,
'--allow-unsafe',
'--strip-extras',
'-q',
'--generate-hashes',
'-o', '@OUTPUT@',
'@INPUT@',
],
)
deps = run_command(python, '-c', install_dependencies, check: true).stdout().strip().split('$$')
if deps.length() > 1
meson.add_postconf_script(pip, 'install', deps)
endif
endif
source_to_build.enable_auto_if(source_to_build.auto())
docs_source = 'docs'
Expand All @@ -214,10 +199,6 @@ configure_file(
command: [python, '-c', meson_setuptools_scm],
output: 'PKG-INFO',
)
deps = run_command(python, '-c', install_dependencies, check: true).stdout().strip().split('$$')
if deps.length() > 1
meson.add_postconf_script(pip, 'install', deps)
endif
meson.add_dist_script(pip, 'install', 'tomli>=2.0.0')
meson.add_dist_script(python, '-c', meson_dist_setuptools_scm)
vcs_tag(input: 'pyproject.toml', output: 'pyproject.orig.toml')
Expand Down
77 changes: 34 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[build-system]
build-backend = "ozi_build.buildapi"
requires = [
"OZI.build[core,uv]~=1.2",
"OZI.build[core,uv]~=1.4",
]

[tool.ozi-build.entry-points]
Expand All @@ -16,55 +16,46 @@ console_scripts = [
]

[tool.ozi-build.metadata]
pkg-info-file = 'PKG-INFO'
summary = 'Package Python projects with Meson.'
download-url = 'https://github.com/OZI-Project/OZI/archive/refs/tags/{version}.tar.gz'
description-file = 'README.rst'
home-page = 'https://oziproject.dev/'
author = 'Eden Ross Duff MSc'
author-email = '[email protected]'
license = 'Apache 2.0 WITH LLVM-exception'
keywords = 'meson,packaging,wheel'
project-urls = [
'Bug Tracker, https://github.com/OZI-Project/OZI/issues',
'Community, https://github.com/orgs/OZI-Project/discussions',
]
requires-external=['git']
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Quality Assurance',
'Typing :: Typed',
]

[tool.setuptools_scm]
version_file_template = """
Metadata-Version: 2.1
Name: @PROJECT_NAME@
Version: @SCM_VERSION@
Summary: Package Python projects with Meson.
Download-URL: https://github.com/rjdbcm/OZI/archive/refs/tags/@[email protected]
Home-page: https://oziproject.dev/
Author: Eden Ross Duff MSc
Author-email: [email protected]
License: @LICENSE@
Keywords: meson,packaging,wheel
Project-URL: Bug Tracker, https://github.com/rjdbcm/ozi/issues
Project-URL: Community, https://github.com/orgs/OZI-Project/discussions
@REQUIREMENTS_IN@
Requires-External: git
Requires-Python: >=3.10, <3.13
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Description-Content-Type: text/x-rst
@README_TEXT@
"""
version_file = "PKG-INFO"
fallback_version = "@VCS_TAG@"
parentdir_prefix_version = "OZI-"
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.in"] }

[project]
dynamic = ["dependencies", "version"]
dynamic = ["version"]
license = {file = "LICENSE.txt"}
dependencies = ['ozi-core~=1.0.0', 'setuptools_scm[toml]', 'tomli>=2.0.0;python_version<"3.11"']

[project.optional_dependencies] # also meson test suite names
# continuous integration
Expand Down Expand Up @@ -374,7 +365,7 @@ package = wheel
deps =
uv
commands_pre =
python -m uv pip install -r requirements.in OZI.build[uv,core]~=1.2
python -m uv pip install OZI.build[uv,core]~=1.4
pipx install --python=python meson
commands =
meson setup {env_tmp_dir} -Ddist=disabled -Dtox-env-dir={env_dir}
Expand Down

0 comments on commit ff8aa92

Please sign in to comment.