Skip to content

Commit

Permalink
Fix package versioning (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
chapimenge3 committed Sep 1, 2022
1 parent 9ddf086 commit 91dbe7b
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 52 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/Linter.yml
Expand Up @@ -27,35 +27,3 @@ jobs:
- name: Analysing the code with pylint
run: |
pylint chapa/*
Publish-Package:
runs-on: ubuntu-latest
needs:
- build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Publish the package
uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
47 changes: 47 additions & 0 deletions .github/workflows/deployment.yml
@@ -0,0 +1,47 @@
name: Deployment

# deploy package to pypi on condition of
# push to main branch
# and release published

on:
release:
types:
- published

jobs:
Publish-Package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Version the package
run: |
echo "__version__ = '${{ github.ref_name }}'" > chapa/__init__.py
export CHAPA_VERSION=${{ github.ref_name }}
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -17,6 +17,7 @@ lib/
lib64/
parts/
sdist/
dist/
var/
wheels/
pip-wheel-metadata/
Expand Down
Binary file removed dist/Chapa-0.0.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/Chapa-0.0.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
43 changes: 24 additions & 19 deletions setup.py
@@ -1,32 +1,37 @@
from ensurepip import version
import setuptools
import os

with open("README.md", "r", encoding="utf-8") as fh:
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()

version = os.environ.get('CHAPA_VERSION')

setuptools.setup(
name="Chapa",
version="0.0.1",
author="Temkin Mengistu, Chapi",
author_email="chapimenge3@gmail.com",
description="Python SDK for Chapa API https://developer.chapa.co",
name='chapa',
version=version,
author='Temkin Mengistu (Chapi)',
author_email='chapimenge3@gmail.com',
description='Python SDK for Chapa API https://developer.chapa.co',
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/chapimenge3/chapa",
long_description_content_type='text/markdown',
url='https://github.com/chapimenge3/chapa',
packages=['chapa'],
package_dir={'chapa': 'chapa'},
project_urls={
"Bug Tracker": "https://github.com/chapimenge3/chapa/issues",
'Source': 'https://github.com/chapimenge3/chapa',
'Bug Tracker': 'https://github.com/chapimenge3/chapa/issues',
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
],
package_dir={"chapa": "chapa"},
packages=setuptools.find_packages(),
python_requires=">=3.6",
python_requires='>=3.6',
install_requires=[
"requests",
'requests',
],
)

0 comments on commit 91dbe7b

Please sign in to comment.