Skip to content

Commit

Permalink
Test Publishing - build yaml Korrektur
Browse files Browse the repository at this point in the history
Signed-off-by: dornech <[email protected]>
  • Loading branch information
dornech committed Nov 24, 2024
1 parent 4bfe69e commit 6f4ba41
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
# repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
verbose: true
# skip-existing: true
# user: __token__
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ allow-direct-references = true

[tool.hatch.version]
source = "vcs"
fallback-version = "0.0.1dev0"
raw-options = { version_scheme = "no-guess-dev" }

[tool.hatch.build.hooks.vcs]
Expand Down Expand Up @@ -189,7 +188,8 @@ ignore = [
"SIM114", # Combine `if` branches using logical `or` operator
"E203", # Whitespace before :, needed for black compatability and also `ruff format`
"ISC001", # causes unexpected behaviour with formatter
"I001" # enforce reorganisation of imports
"I001", # enforce reorganisation of imports
"T201" # print statements
]
unfixable = [
# "F401", # Don't touch unused imports
Expand Down
50 changes: 25 additions & 25 deletions src/pytestdornech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
Notion-API: https://developers.notion.com/reference/intro
"""

from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version('pytestdornech')
except PackageNotFoundError: # pragma: no cover
__version__ = 'unknown'
finally:
del version, PackageNotFoundError
# from importlib.metadata import PackageNotFoundError, version
#
# try:
# __version__ = version('pytestdornech')
# except PackageNotFoundError: # pragma: no cover
# __version__ = 'unknown'
# finally:
# del version, PackageNotFoundError


# up-to-date version tag for modules installed in editable mode inspired by
# https://github.com/maresb/hatch-vcs-footgun-example/blob/main/hatch_vcs_footgun_example/__init__.py
# Define the variable '__version__':
# try:
# # If setuptools_scm is installed (e.g. in a development environment with
# # an editable install), then use it to determine the version dynamically.
# from setuptools_scm import get_version
# # This will fail with LookupError if the package is not installed in
# # editable mode or if Git is not installed.
# __version__ = get_version(root="..", relative_to=__file__)
# except (ImportError, LookupError):
# # As a fallback, use the version that is hard-coded in the file.
# try:
# from ._version import __version__ # noqa: F401
# except ModuleNotFoundError:
# # The user is probably trying to run this without having installed the
# # package, so complain.
# raise RuntimeError(
# f"Package {__package__} is not correctly installed. Please install it with pip."
# )
try:
# If setuptools_scm is installed (e.g. in a development environment with
# an editable install), then use it to determine the version dynamically.
from setuptools_scm import get_version
# This will fail with LookupError if the package is not installed in
# editable mode or if Git is not installed.
__version__ = get_version(root="..\..", relative_to=__file__)
except (ImportError, LookupError):
# As a fallback, use the version that is hard-coded in the file.
try:
from ._version import __version__ # noqa: F401
except ModuleNotFoundError:
# The user is probably trying to run this without having installed the
# package, so complain.
raise RuntimeError(
f"Package {__package__} is not correctly installed. Please install it with pip."
)
2 changes: 1 addition & 1 deletion src/pytestdornech/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ def main(


if __name__ == '__main__':
# print(f"My version is '{__version__}'.\n")
print(f"My version is '{__version__}'.\n")
app()

0 comments on commit 6f4ba41

Please sign in to comment.