Skip to content

Commit

Permalink
Files required for PyPi support (#33)
Browse files Browse the repository at this point in the history
* PyPi support

* v3.5 no longer available

* Only check installability

* Make setuptools happy

* Update setup.py

Co-authored-by: Toche Camille <tochecamille@gmail.com>
  • Loading branch information
dvershinin and CamTosh authored Jan 27, 2022
1 parent c49bbad commit b718c86
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Python package

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Only check installability
run: |
python -m pip install --upgrade pip
pip install -e .
26 changes: 26 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
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: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions __about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.0.1'
36 changes: 36 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from setuptools import find_packages, setup
from io import open
import os
import re

_version_re = re.compile(r"__version__\s=\s'(.*)'")

install_requires = ['webdriver_manager', 'selenium']
with open("readme.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

base_dir = os.path.dirname(__file__)

with open(os.path.join(base_dir, "__about__.py"), 'r') as f:
version = _version_re.search(f.read()).group(1)

setup(
name="instadm",
version=version,
author="Toche Camille",
author_email="tochecamille@gmail.com",
url="https://github.com/CamTosh/instagram-bot-dm",
description="Instagram bot to send direct messages",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(exclude=["tests", "docs"]),
zip_safe=False,
license="GPLv3",
install_requires=install_requires,
include_package_data=True,
classifiers=[
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development",
],
)

0 comments on commit b718c86

Please sign in to comment.