Skip to content

Commit

Permalink
Merge ffe3735 into b97818b
Browse files Browse the repository at this point in the history
  • Loading branch information
sglavoie committed Jul 3, 2020
2 parents b97818b + ffe3735 commit cc80fea
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 31 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -94,4 +94,7 @@ ENV/
*iml

# VS Code
.vscode/
.vscode/

# Makefile
.make-cache
10 changes: 0 additions & 10 deletions .travis.yml
Expand Up @@ -4,11 +4,6 @@ sudo:
dist:
trusty

addons:
apt:
packages:
- pandoc

language:
python

Expand All @@ -30,11 +25,6 @@ script:
after_success:
- coveralls

before_deploy:
- pandoc --version
- pandoc -f markdown_github -t rst -o README.rst README.md
- mv README.rst README.md

deploy:
provider: pypi
user: brew
Expand Down
59 changes: 46 additions & 13 deletions Makefile
@@ -1,9 +1,28 @@
.PHONY: all install list readme release test version
PYTHON := python
PIP := pip
GIT := git

BUILD_DIR := build
DIST_DIR := dist
SENTINELS := .make-cache

SOURCE_FILES := $(shell find ./frictionless_ckan_mapper -type f -name "*.py")

PACKAGE := $(shell grep '^PACKAGE =' setup.py | cut -d "'" -f2)
VERSION := $(shell head -n 1 $(PACKAGE)/VERSION)

.PHONY: all dist distclean install list release test version

## Clean all generated files
distclean:
rm -rf $(BUILD_DIR) $(DIST_DIR)
rm -rf $(SENTINELS)/dist

## Create distribution files to upload to pypi
dist: $(SENTINELS)/dist



all: list

install:
Expand All @@ -12,18 +31,32 @@ install:
list:
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'

readme:
pip install md-toc
md_toc -p README.md github --header-levels 3
sed -i '/(#tableschema-spss-py)/,+2d' README.md

release:
git checkout master && git pull origin && git fetch -p && git diff
@echo "\nContinuing in 10 seconds. Press <CTRL+C> to abort\n" && sleep 10
@git log --pretty=format:"%C(yellow)%h%Creset %s%Cgreen%d" --reverse -20
@echo "\nReleasing v$(VERSION) in 10 seconds. Press <CTRL+C> to abort\n" && sleep 10
git commit -a -m 'v$(VERSION)' && git tag -a v$(VERSION) -m 'v$(VERSION)'
git push --follow-tags
## Upload a release of the package to PyPi and create a Git tag
release: $(SENTINELS)/dist
@echo
@echo "You are about to release authoritative version $(VERSION)"
@echo "This will:"
@echo " - Create a git tag release-$(VERSION)"
@echo " - Create a release package and upload it to pypi"
@echo
@echo "Continue? (hit Enter to continue or Ctrl+C to stop)"
@read
$(GIT) tag release-$(VERSION)
$(GIT) push --tags
$(PYTHON) -m twine upload dist/*

$(SENTINELS):
mkdir $@

$(SENTINELS)/dist-setup: | $(SENTINELS)
$(PIP) install -U pip wheel twine
@touch $@

$(SENTINELS)/dist: $(SENTINELS)/dist-setup $(DIST_DIR)/frictionless-ckan-mapper-$(VERSION).tar.gz $(DIST_DIR)/frictionless-ckan-mapper-$(VERSION)-py2.py3-none-any.whl | $(SENTINELS)
@touch $@

$(DIST_DIR)/frictionless-ckan-mapper-$(VERSION).tar.gz $(DIST_DIR)/frictionless-ckan-mapper-$(VERSION)-py2.py3-none-any.whl: $(SOURCE_FILES) setup.py | $(SENTINELS)/dist-setup
$(PYTHON) setup.py sdist bdist_wheel --universal

test:
pylama $(PACKAGE)
Expand Down
14 changes: 10 additions & 4 deletions setup.py
Expand Up @@ -22,8 +22,7 @@ def read(*paths):
]
TESTS_REQUIRE = [
'pylama',
'tox',
'requests_mock'
'tox'
]
README = read('README.md')
VERSION = read(PACKAGE, 'VERSION')
Expand All @@ -41,13 +40,20 @@ def read(*paths):
extras_require={'develop': TESTS_REQUIRE},
zip_safe=False,
long_description=README,
description='{{ DESCRIPTION }}',
long_description_content_type='text/markdown',
description='A library for mapping CKAN metadata <=> Frictionless metadata.',
author='Open Knowledge International',
url='https://github.com/frictionlessdata/frictionless_ckan_mapper',
copyright='Copyright 2020 (c) Viderum Inc. / Datopian',
license='MIT',
keywords=[
'data',
'ckan'
'ckan',
'frictionless',
'conversion',
'package',
'dataset',
'resource'
],
classifiers=[
'Environment :: Web Environment',
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Expand Up @@ -10,9 +10,6 @@ deps=
pytest
pytest-cov
coverage
mock
requests_mock
datapackage>=1.0,<2.0
passenv=
CI
TRAVIS
Expand Down

0 comments on commit cc80fea

Please sign in to comment.