diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dec4526 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish Package + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + + - name: Clone the repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pip install build + + - name: Build distribution + run: python -m build + + - name: Publish the package + uses: pypa/gh-action-pypi-publish@v1.9.0 diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 6a636af..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/.gitignore b/.gitignore index 483ec57..25b405a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ env/ py1337x/__pycache__/ dist/ -1337x.egg-info/ \ No newline at end of file +1337x.egg-info/ +poetry.lock \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3f0a4d0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,35 @@ +[tool.poetry] +name = "1337x" +version = "1.2.6" +description = "Unofficial API of 1337x.to" +authors = ["Hemanta Pokharel "] +license = "MIT" +readme = "README.md" +repository = "https://github.com/hemantapkh/1337x" +documentation = "https://github.com/hemantapkh/1337x/blob/main/README.md" +urls = { "Issue tracker" = "https://github.com/hemantapkh/1337x/issues" } +keywords = ["1337x", "torrents"] +packages = [ + { include = "py1337x" } +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Utilities" +] + + +[tool.poetry.dependencies] +python = "^3.8" +requests = "^2.32.3" +beautifulsoup4 = "^4.12.3" +requests-cache = "^1.2.1" +cloudscraper = "^1.2.71" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8920981..0000000 --- a/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -attrs==23.2.0 -beautifulsoup4==4.12.3 -bs4==0.0.2 -cattrs==23.2.3 -certifi==2024.2.2 -charset-normalizer==3.3.2 -cloudscraper==1.2.71 -idna==3.7 -platformdirs==4.2.1 -pyparsing==3.1.2 -requests==2.31.0 -requests-cache==1.2.0 -requests-toolbelt==1.0.0 -six==1.16.0 -soupsieve==2.5 -url-normalize==1.4.3 -urllib3==2.2.1