-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add action, update setup.py (#3)
- Loading branch information
Showing
4 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# any syntax error, break build | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,64 @@ | ||
import setuptools | ||
import io | ||
import os | ||
import sys | ||
from shutil import rmtree | ||
from setuptools import Command, find_packages, setup | ||
|
||
setuptools.setup( | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
class UploadCommand(Command): | ||
description = "Build and publish the package." | ||
user_options = [] | ||
|
||
@staticmethod | ||
def status(s): | ||
print("✨✨ {0}".format(s)) | ||
|
||
def initialize_options(self): | ||
pass | ||
|
||
def finalize_options(self): | ||
pass | ||
|
||
def run(self): | ||
try: | ||
self.status("Removing previous builds…") | ||
rmtree(os.path.join(here, "dist")) | ||
rmtree(os.path.join(here, "build")) | ||
rmtree(os.path.join(here, "{0}.egg-info".format("streamlit_g2"))) | ||
except OSError: | ||
pass | ||
|
||
self.status("Building Source and Wheel distribution…") | ||
os.system("{0} setup.py bdist_wheel".format(sys.executable)) | ||
|
||
self.status("Uploading the package to PyPI via Twine…") | ||
os.system("twine upload dist/*") | ||
|
||
sys.exit() | ||
|
||
def read(*names, **kwargs): | ||
return io.open( | ||
os.path.join(os.path.dirname(__file__), *names), | ||
encoding=kwargs.get("encoding", "utf8") | ||
).read() | ||
|
||
setup( | ||
name="streamlit-g2", | ||
version="0.0.6", | ||
version="0.1.0", | ||
author="hustcc", | ||
author_email="[email protected]", | ||
description="Render G2 charts in Streamlit", | ||
long_description="Render G2 charts in Streamlit", | ||
long_description=read('readme.md'), | ||
long_description_content_type="text/plain", | ||
keywords=["antv", "g2", "streamlit-component", "streamlit-g2"], | ||
url="https://github.com/hustcc/streamlit-g2", | ||
packages=setuptools.find_packages(), | ||
packages=find_packages(), | ||
include_package_data=True, | ||
classifiers=[], | ||
python_requires=">=3.6", | ||
install_requires=[ | ||
"streamlit >= 0.63", | ||
], | ||
cmdclass={"upload": UploadCommand}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import pytest | ||
|
||
def test_meta(): | ||
assert "1" == "1" |