diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..cd205e6 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,39 @@ +name: Deploy to PyPi + +on: + push: + tags: + - 'v*' + +jobs: + pypi-publish: + name: Upload to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/install-texlive + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + + # make sure we have version info + - run: git fetch --tags + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python --version + pip install -U build + python -m build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.pypi_password }} + diff --git a/.gitignore b/.gitignore index bb5cf86..db25914 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +_version.py # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/install_texlive/__init__.py b/install_texlive/__init__.py index a90e462..8e12d45 100644 --- a/install_texlive/__init__.py +++ b/install_texlive/__init__.py @@ -8,9 +8,21 @@ from functools import lru_cache from io import StringIO from html.parser import HTMLParser +from ._version import __version__, __version_tuple__ -__version__ = '0.3.4' +__all__ = [ + "__version__", + "__version_tuple__", + "command", + "download", + "get_mirror", + "get_size", + "is_current", + "URL", + "OLDURL", +] + log = logging.getLogger(__name__) diff --git a/pyproject.toml b/pyproject.toml index fed528d..67a422f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,35 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=60", "setuptools-scm>=8.0"] build-backend = "setuptools.build_meta" + +[project] +name = "install-texlive" +description = "Install texlive without human interaction in the process" +license = {text = "MIT License"} +authors = [ + { name = "Maximilian Linhoff", email = "maximilian.linhoff@tu-dortmund.de" }, +] +requires-python = ">=3.8" +dependencies = [ + "pexpect", + "requests", +] +readme = "README.md" +dynamic = ["version"] +classifiers = [ + "LICENSE :: OSU Aprroved :: MIT License", + "Development Status :: 5 - Production/Stable", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Text Processing :: Markup :: LaTeX", +] + +[project.urls] +repository = "http://github.com/maxnoe/texlive-batch-installation" + +[project.scripts] +install_texlive = "install_texlive.__main__:main" + +[tool.setuptools_scm] +version_file = "install_texlive/_version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8a49868..0000000 --- a/setup.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[metadata] -name = install_texlive -version = attr: install_texlive.__version__ -description = Install texlive without human interaction in the process -url = http://github.com/maxnoe/texlive-batch-installation -author = Maximilian Linhoff -author_email = maximilian.linhoff@tu-dortmund.de -license = MIT - -[options] -packages = find: -install_requires = - pexpect - requests - -[options.entry_points] -console_scripts = - install_texlive = install_texlive.__main__:main