Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action publish #13

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Python Package

on:
release:
types: [created]
pull_request:
branches:
- master
push:
branches:
- master

jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine
- name: Fix Windows build environment
if: startsWith(matrix.os, 'windows')
run: |
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: mashingpumpkins_${{ matrix.python-version}}_${{ matrix.os }}
path: dist/
- name: Publish
if: github.event_name == 'created'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
17 changes: 5 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,23 @@ matrix:
compiler: gcc
dist: xenial
sudo: true
- os: osx
python: 3.5
- os: linux
python: 3.8
compiler: clang
dist: xenial
sudo: true
- os: osx
python: 3.5
compiler: gcc
- os: osx
python: 3.6
compiler: clang
- os: osx
python: 3.6
compiler: gcc
- os: osx
python: 3.7
compiler: clang
- os: osx
python: 3.7
compiler: gcc
- os: osx
python: 3.8
compiler: clang
- os: osx
python: 3.8
compiler: gcc
compiler: clang

before_install:
- pip install codecov
Expand Down
69 changes: 39 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from distutils.core import setup, Extension
from setuptools import setup, Extension
import os
import warnings

Expand All @@ -17,6 +17,8 @@
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
]

Expand All @@ -30,51 +32,58 @@
elif sys.platform == 'linux':
pass
else:
raise ValueError("The platform %s is not supported." % sys.platform)
warnings.warn("The platform %s is not supported. "
"This may or may not work" % sys.platform)

mmh_mod = Extension("%s._murmurhash3" % PACKAGENAME,
sources=["src/_murmurhash3.cpp", "src/MurmurHash3.cpp"],
depends=["src/MurmurHash3.h"],
include_dirs=["src",],
language="c++",
extra_compile_args = extra_compile_args + \
['-O3'])
extra_compile_args=(extra_compile_args+
['-O3']))

mmhmash_mod = Extension("%s._murmurhash3_mash" % PACKAGENAME,
sources=["src/_murmurhash3_mash.cpp", "src/MurmurHash3.cpp"],
sources=["src/_murmurhash3_mash.cpp",
"src/MurmurHash3.cpp"],
depends=["src/MurmurHash3.h"],
include_dirs=["src",],
language="c++",
extra_compile_args = extra_compile_args + \
['-O3'])
extra_compile_args=(extra_compile_args+
['-O3']))

xxh_mod = Extension("%s._xxhash" % PACKAGENAME,
sources=["src/_xxhash.c", "src/xxhash.c"],
depends=["src/xxhash.h"],
include_dirs=["src",],
language="c",
extra_compile_args = extra_compile_args + \
['-O3',
'-std=c99',
'-Wall', '-Wextra', '-Wcast-qual', '-Wcast-align', '-Wshadow',
'-Wstrict-aliasing=1', '-Wswitch-enum', '-Wdeclaration-after-statement',
'-Wstrict-prototypes', '-Wundef'])
extra_compile_args = (
extra_compile_args +
['-std=c99',
'-Wall',
'-Wcast-align', '-Wshadow',
'-Wstrict-aliasing=1', '-Wswitch-enum',
'-Wdeclaration-after-statement',
'-Wstrict-prototypes', '-Wundef'] +
(['-O2', '-c', '-DXXH_MULTI_TARGET=1']
if sys.platform == 'windows'
else ['-O3', '-Wextra', '-Wcast-qual'])
)
)

setup(
name = PYPINAME,
version = VERSION,
description = "Hash sketches of sequences",
license = "MIT",
author = "Laurent Gautier",
author_email = "[email protected]",
url = "https://github.com/lgautier/mashing-pumpkins",
packages = [PACKAGENAME,
PACKAGENAME + '.tests'],
package_dir = {PACKAGENAME: 'src'},
ext_modules = [mmh_mod, mmhmash_mod, xxh_mod],
extras_require = {
'test' : ['pytest']},
classifiers = CLASSIFIERS)



name=PYPINAME,
version=VERSION,
description="Hash sketches of sequences",
license="MIT",
author="Laurent Gautier",
author_email="[email protected]",
url="https://github.com/lgautier/mashing-pumpkins",
packages=[PACKAGENAME,
PACKAGENAME + '.tests'],
package_dir={PACKAGENAME: 'src'},
ext_modules=[mmh_mod, mmhmash_mod, xxh_mod],
requires=['setuptools'],
extras_require={
'test': ['pytest']},
classifiers=CLASSIFIERS)