Skip to content

Commit

Permalink
Publish to PyPI using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnesayeed committed Jun 15, 2021
1 parent 695522a commit 57b57df
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish to PyPI

on:
push:
tags:
- '*'

jobs:
build-n-publish:
name: Build and Publish Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Upgrade setuptools and wheel
run: python -m pip install --user --upgrade setuptools wheel
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
1 change: 1 addition & 0 deletions mementomap/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__VERSION__ = "0.1.0b1"
13 changes: 11 additions & 2 deletions main.py → mementomap/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import argparse
import gzip
import sys
import os

from mementomap.mementomap import compact, generate, lookup
if not __package__:
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

from mementomap import __VERSION__
from mementomap.cli import compact, generate, lookup


def run_generate(**kw):
Expand Down Expand Up @@ -60,7 +65,7 @@ def run_batchlookup(**kw):
mobj.close()


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()

Expand Down Expand Up @@ -105,3 +110,7 @@ def run_batchlookup(**kw):
args.func(**vars(args))
except Exception as e:
parser.print_help()


if __name__ == "__main__":
main()
File renamed without changes.
38 changes: 38 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import setuptools

from mementomap import __VERSION__

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="mementomap",
version=__VERSION__,
author="Sawood Alam",
author_email="ibnesayeed@gmail.com",
description="A Tool to Summarize Web Archive Holdings",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/oduwsdl/MementoMap",
license="MIT License",
packages=setuptools.find_packages(),
provides=[
"mementomap"
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Environment :: Console",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
"Development Status :: 4 - Beta"
],
python_requires='>=3.6',
entry_points={
"console_scripts": [
"mementomap = mementomap.__main__:main"
]
}
)

0 comments on commit 57b57df

Please # to comment.