Skip to content
Snippets Groups Projects
Select Git revision
  • 0db81f9c7e0e7a8144d11f1b4545fc5f03f0b621
  • master default protected
  • devel
  • misp
  • stix
  • cejkat-pr
6 results

Makefile

Blame
  • Makefile 1.90 KiB
    #-------------------------------------------------------------------------------
    # Copyright (c) since 2016, CESNET, z. s. p. o.
    # Authors: Pavel Kácha <pavel.kacha@cesnet.cz>
    #          Jan Mach <jan.mach@cesnet.cz>
    # Use of this source is governed by an ISC license, see LICENSE file.
    #-------------------------------------------------------------------------------
    
    all: archive bdist deploy
    
    build: archive bdist
    
    help:
    	$(info List of possible make targets:)
    	$(info   )
    	$(info   * all:     archive previous packages, build new distribution and deploy to PyPI [default])
    	$(info   * build:   archive previous packages and build new distribution)
    	$(info   * test:    run unit tests)
    	$(info   * archive: archive previous packages)
    	$(info   * bdist:   build new distribution)
    	$(info   * install: install distribution on local machine)
    	$(info   * deploy:  deploy to PyPI)
    	$(info   )
    
    # Perform unit tests
    test: FORCE
    	$(info Testing source code)
    	nosetests
    
    # Move old distribution files to archive directory
    archive: FORCE
    	$(info Checking if dist archivation is needed)
    	@if ! [ `ls dist/idea-format* | wc -l` = "0" ]; then\
    		echo "Moving old distribution files to local archive";\
    		mv -f dist/idea-format* archive;\
    	fi
    
    # Build various Python package distributions
    bdist:
    	$(info Building distributions)
    
    	# Build and upload (insecure)
    	#python3 setup.py sdist bdist_wheel upload
    
    	# Build only
    	python3 setup.py sdist bdist_wheel --universal
    
    # Perform installation from local files for both Python 2 and 3
    install: FORCE
    	$(info Local installation)
    	pip install dist/idea-format*.whl
    	pip3 install dist/idea-format*.whl
    
    # Deploy latest packages to PyPI
    deploy: FORCE
    	$(info PyPI deployment)
    
    	# Secure upload with Twine
    	twine upload dist/idea-format* dist/idea_format*
    
    # Empty rule as dependency wil force make to always perform target
    # Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
    FORCE: