From 49b398e5e1d314cdda2da7d45d263a6c550eb7fd Mon Sep 17 00:00:00 2001 From: Agah Date: Wed, 24 Jul 2024 15:46:42 -0400 Subject: [PATCH] Add release workflows --- .github/workflows/test_release.yml | 31 ++++++++++++++++++++++ .github/workflows/workflow.yml | 32 +++++++++++++++++++++++ .gitignore | 2 ++ pyproject.toml | 41 ++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 .github/workflows/test_release.yml create mode 100644 .github/workflows/workflow.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml new file mode 100644 index 0000000..0d84515 --- /dev/null +++ b/.github/workflows/test_release.yml @@ -0,0 +1,31 @@ +name: Publish Python 🐍 distribution to TestPyPI +on: push + +jobs: + pypi-test-publish: + name: upload release to TestPyPI + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: test_release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10.4' + cache: pip + cache-dependency-path: '**/pyproject.toml' + - name: Install dependencies + run: | + pip install setuptools wheel build twine setuptools_scm + - name: Build + run: | + python -m build + # retrieve your distributions here + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..bb396be --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,32 @@ +name: publish +on: + push: + tags: + - 'v*.*.*' + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10.4' + cache: pip + cache-dependency-path: '**/pyproject.toml' + - name: Install dependencies + run: | + pip install setuptools wheel build twine setuptools_scm + - name: Build + run: | + python -m build + # retrieve your distributions here + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2696172..4bba253 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ tests/in/neurolibre/data # Build dir /build/ + +.DS_Store \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7abf09d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "repo2data" +dynamic = ["version"] +description = "A Python package to automate the fetching and extraction of data from remote sources like Amazon S3, Zeonodo, Datalad, Google Drive, OSF, or any public download URL." +authors = [ + { name="ltetrel", email="roboneurolibre@gmail.com" }, + { name="agahkarakuzu", email="agahkarakuzu@gmail.com" } +] +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.7" +keywords = ["neurolibre", "open-data", "reproducible", "osf", "zenodo","datalad","conp","gdown","aws"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + 'awscli', + 'patool', + 'datalad', + 'requests', + 'osfclient', + 'gdown', + 'zenodo-get', + 'requests' +] + +[project.scripts] +repo2data = "bin/repo2data:main" + +[project.urls] +Homepage = "https://github.com/SIMEXP/Repo2Data" + +[tool.setuptools_scm] +version_scheme = "post-release" +local_scheme = "dirty-tag" \ No newline at end of file