Skip to content

Commit

Permalink
Test Publishing - diverses u. a. vcs Änderungen
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 fa29a83 commit 511acb0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
3 changes: 2 additions & 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 All @@ -113,6 +113,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
# url = "https://upload.pypi.org/legacy/"
verbose: true
# user: __token__
# password: ${{ secrets.PYPI_SECRECT }}
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Dornech's testpackage"
readme = "README.md"
requires-python = ">=3.9"
# only license identifier from https://spdx.org/licenses/ are allowed
license = { text = "MIT"}
license = { text = "MIT" }
# keywords for easier look-up on PyPI
keywords = ["keyword_1", "keyword_2"] # ToDo: Modify according to your needs!
authors = [
Expand All @@ -30,13 +30,17 @@ classifiers = [ # ToDo: Modify according to your needs!
]
# direct dependencies of this package, installed when users `pip install pytestdornech` later.
dependencies = [ # ToDo: Modify according to your needs!
"setuptools_scm",
"typer",
# "numpy",
# "matplotlib",
# "seaborn",
]
dynamic = ["version"]

[project.optional-dependencies]
# n. a.

[project.scripts]
# Use `fibonacci` as command-line script, comment or remove this section if not needed.
fibonacci = "pytestdornech.skeleton:app"
Expand All @@ -59,6 +63,7 @@ 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
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."
# )
1 change: 1 addition & 0 deletions src/pytestdornech/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ def main(


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

0 comments on commit 511acb0

Please sign in to comment.