Skip to content

Commit b718c86

Browse files
dvershininCamTosh
andauthored
Files required for PyPi support (#33)
* PyPi support * v3.5 no longer available * Only check installability * Make setuptools happy * Update setup.py Co-authored-by: Toche Camille <tochecamille@gmail.com>
1 parent c49bbad commit b718c86

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Python package
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Only check installability
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e .
24+

.github/workflows/pythonpublish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

__about__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.0.1'

setup.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from setuptools import find_packages, setup
2+
from io import open
3+
import os
4+
import re
5+
6+
_version_re = re.compile(r"__version__\s=\s'(.*)'")
7+
8+
install_requires = ['webdriver_manager', 'selenium']
9+
with open("readme.md", "r", encoding="utf-8") as fh:
10+
long_description = fh.read()
11+
12+
base_dir = os.path.dirname(__file__)
13+
14+
with open(os.path.join(base_dir, "__about__.py"), 'r') as f:
15+
version = _version_re.search(f.read()).group(1)
16+
17+
setup(
18+
name="instadm",
19+
version=version,
20+
author="Toche Camille",
21+
author_email="tochecamille@gmail.com",
22+
url="https://github.com/CamTosh/instagram-bot-dm",
23+
description="Instagram bot to send direct messages",
24+
long_description=long_description,
25+
long_description_content_type="text/markdown",
26+
packages=find_packages(exclude=["tests", "docs"]),
27+
zip_safe=False,
28+
license="GPLv3",
29+
install_requires=install_requires,
30+
include_package_data=True,
31+
classifiers=[
32+
"Intended Audience :: Developers",
33+
"Operating System :: OS Independent",
34+
"Topic :: Software Development",
35+
],
36+
)

0 commit comments

Comments
 (0)