Skip to content

Commit

Permalink
exclude version.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
vgp57214_gsk committed Feb 12, 2024
1 parent 58ce3bf commit 5904fe8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
16 changes: 4 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
import os
import shlex
from importlib.metadata import version

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -82,19 +83,10 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# We store our version number in a simple text file:
version_path = os.path.join(
os.path.dirname(__file__),
os.pardir, os.pardir,
'pymzml', 'version.txt'
)
with open(version_path, 'r') as version_file:
pymzml_version = version_file.read().strip()

# The short X.Y version.
version = pymzml_version
# The full version, including alpha/beta/rc tags.
release = pymzml_version
release = version("ursgal")
# # for example take major/minor
version = ".".join(release.split(".")[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
11 changes: 8 additions & 3 deletions pymzml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@

import os
import sys
from importlib.metadata import PackageNotFoundError, version

if not hasattr(sys, "version_info") or sys.version_info < (3, 4):
raise RuntimeError("pymzML requires Python 3.4 or later.")

# Set version
version_path = os.path.join(os.path.dirname(__file__), "version.txt")
with open(version_path, "r") as version_file:
__version__ = version_file.read().strip()
try:
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = None
# version_path = os.path.join(os.path.dirname(__file__), "version.txt")
# with open(version_path, "r") as version_file:
# __version__ = version_file.read().strip()

# Imports of individual modules
import pymzml.run
Expand Down
1 change: 0 additions & 1 deletion pymzml/version.txt

This file was deleted.

0 comments on commit 5904fe8

Please sign in to comment.