diff --git a/.github/workflows/package-and-publish.yml b/.github/workflows/package-and-publish.yml index 24c1f19..d237649 100644 --- a/.github/workflows/package-and-publish.yml +++ b/.github/workflows/package-and-publish.yml @@ -27,36 +27,36 @@ jobs: name: python-package-distributions path: dist/ - #run_tests: - # name: Run the tests - # runs-on: ubuntu-latest - # needs: - # - build - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python - # uses: actions/setup-python@v5 - # with: - # python-version: "3.12" - # - name: Download the distribution packages - # uses: actions/download-artifact@v4 - # with: - # name: python-package-distributions - # path: dist/ - # - name: Install dependencies - # run: >- - # python3 -m - # pip install - # pytest - # --user - # - name: Install locally the built distribution packages - # run: >- - # python3 -m - # pip install - # dist/*.whl - # --user - # - name: Run the tests - # run: python3 -m pytest + run_tests: + name: Run the tests + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Download the distribution packages + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Install dependencies + run: >- + python3 -m + pip install + pytest + --user + - name: Install locally the built distribution packages + run: >- + python3 -m + pip install + dist/*.whl + --user + - name: Run the tests + run: python3 -m pytest diff --git a/pyproject.toml b/pyproject.toml index 4ba0f5c..9bf38c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,37 +1,6 @@ -[project] -name = "freestylo" -version = "0.1.0" -authors = [ - { name = "Felix Schneider", email = "felix.schneider@uni-jena.de"}, -] -description = "A tool for stylistic device detection" -readme = "README.md" -# smaller than 3.10, bigger than 3.6 -requires-python = ">=3.12" -classifiers = [ - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - ] - -[project.scripts] -freestylo = "freestylo:freestylo_main" - -[project.urls] -Homepage = "https://github.com/cvjena/freestylo" -Issues = "https://github.com/cvjena/freestylo/issues" - [build-system] -requires = [ - "setuptools>=75.0", - "torch", - "spacy==3.8.2", - "numpy", - "pytest", - "scikit-learn", - "scipy", - "cltk<1.0", - "wget" - - ] -build-backend = "setuptools.build_meta" +requires = ["setuptools>=75.0.0","setuptools_scm[toml]>=5", "wheel"] +build-backend = "setuptools.build_meta" +[tool.setuptools_scm] +version_scheme = "no-guess-dev" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..e74b1f9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,57 @@ +[metadata] +name = freestylo +version = 0.2.0 +description = A tool for stylistic device detection." +author = Felix Schneider +author_email = felix.schneider@uni-jena.de +# license = GNU General Public License v3.0 +# license_file = LICENSE +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/cvjena/freestylo +project_urls = + Source = https://github.com/cvjena/freestylo + Tracker = https://github.com/cvjena/freestylo/issues + +platforms = any +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + +[options] +zip_safe = False +packages = find_namespace: +include_package_data = True +package_dir = + =src + +python_requires = >=3.12 +install_requires = + setuptools>=75.0 + torch + spacy==3.8.2 + numpy + pytest + scikit-learn + scipy + cltk<1.0 + wget + +[options.packages.find] +where = src +exclude = + tests + +[options.extras_require] +testing = + setuptools>=75.0 + pytest + pytest-cov + +[tool:pytest] +addopts = --cov=freestylo --cov-report=term-missing +testpaths = tests +norecursedirs = + .git + dist + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4d63ef5 --- /dev/null +++ b/setup.py @@ -0,0 +1,8 @@ +from setuptools import setup + +if __name__ == "__main__": + try: + setup(use_scm_version={"version_scheme": "no-guess-dev"}) + except: + print("Error: setup.py failed") + raise