Skip to content

Commit

Permalink
Moved VERSION file inside the package to be store with the installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Caparrini committed Nov 7, 2024
1 parent 632f4e3 commit d142c54
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from plotly.io._sg_scraper import plotly_sg_scraper

Check notice on line 11 in docs/conf.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Accessing a protected member of a class or a module

Access to a protected member _sg_scraper of a class

# Path to the VERSION file
version_file = pathlib.Path(__file__).parent.parent / "VERSION"
version_file = pathlib.Path(__file__).parent.parent / "mloptimizer" / "VERSION"
version = version_file.read_text().strip()

sys.path.insert(0, os.path.abspath('..'))
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mloptimizer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def get_version():
# Read the version from the VERSION file located one directory up
version_file = Path(__file__).resolve().parent.parent / "VERSION"
version_file = Path(__file__).resolve().parent / "VERSION"
with open(version_file) as f:
return f.read().strip()

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.md").read_text(encoding="utf-8")
version = (here / "VERSION").read_text().strip()
version = (here / "mloptimizer" / "VERSION").read_text().strip()



Expand Down Expand Up @@ -140,7 +140,7 @@ def read_requirements(requirements_file):
# If there are data files included in your packages that need to be
# installed, specify them here.
package_data={ # Optional
"mloptimizer": ["infrastructure/config/**/*"],
"mloptimizer": ["infrastructure/config/**/*", "VERSION"],
},
# Entry points. The following would provide a command called `sample` which
# executes the function `main` from this package when invoked:
Expand Down

0 comments on commit d142c54

Please sign in to comment.