Skip to content

Commit

Permalink
Merge pull request #70 from pralab/68-release-management
Browse files Browse the repository at this point in the history
Fix build
  • Loading branch information
maurapintor authored Mar 20, 2024
2 parents 96a2548 + 6bb8d6c commit 4868488
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
main
paths:
- 'VERSION'
- 'src/secmlt/VERSION'

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
author = "Maura Pintor, Luca Demetrio"


version_path = pathlib.Path(__file__).parent.parent.parent / "VERSION"
version_path = pathlib.Path(__file__).parent.parent.parent / "src/secmlt" / "VERSION"


# Get the version file from VERSION file
with version_path.open() as f:
Expand Down
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

from setuptools import find_packages, setup

readme = pathlib.Path(__file__).parent.resolve() / "README.md"
version = pathlib.Path(__file__).parent.resolve() / "VERSION"
here = pathlib.Path.cwd()
readme_path = here / "README.md"
version_path = here / "src/secmlt" / "VERSION"


# Get the long description from the README file
with readme.open() as f:
with readme_path.open() as f:
long_description = f.read()

# Get the version file from VERSION file
with version.open() as f:
version_nr = f.read()
# Get the version from VERSION file
with version_path.open() as f:
version = f.read()


CLASSIFIERS = """\
Expand All @@ -34,7 +36,7 @@

setup(
name="secml-torch",
version=version_nr,
version=version,
description="SecML-Torch Library",
classifiers=[_f for _f in CLASSIFIERS.split("\n") if _f],
long_description=long_description,
Expand All @@ -49,6 +51,7 @@
"tests",
],
),
data_files=[("src/secmlt/VERSION", ["src/secmlt/VERSION"])],
include_package_data=True,
url="https://secml-torch.readthedocs.io/en/latest/",
license="MIT",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/secmlt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pathlib

version_path = pathlib.Path(__file__).parent.parent.parent / "VERSION"
version_path = pathlib.Path(__file__).parent / "VERSION"

with version_path.open() as f:
__version__ = f.read()

0 comments on commit 4868488

Please sign in to comment.