<commit_before>#!/usr/bin/env python
#
# Copyright 2019-2019 by <NAME>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# script/upload-conan.py, Python 3.4 and later
#

import argparse
import os
import re
import sys
import subprocess

# Configuration:

cfg_github_project = 'gsl-lite'
cfg_github_user    = 'martinmoene'

cfg_conanfile      = 'conanfile.py'
cfg_readme         = 'Readme.md'
cfg_license        = 'LICENSE'
cfg_ref_prefix     = 'v'

cfg_sha512            = 'dadeda'
cfg_vcpkg_description = '(no description found)'
cfg_vcpkg_root        = os.environ['VCPKG_ROOT']

# End configuration.

# vcpkg  control and port templates:

tpl_path_vcpkg_control  = '{vcpkg}/ports/{prj}/CONTROL'
tpl_path_vcpkg_portfile = '{vcpkg}/ports/{prj}/portfile.cmake'

tpl_vcpkg_control =\
"""Source: {prj}
Version: {ver}
Description: {desc}"""

tpl_vcpkg_portfile =\
"""include(vcpkg_common_functions)

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO {usr}/{prj}
    REF {ref}
    SHA512 {sha}
)

file(INSTALL ${{SOURCE_PATH}}/include/ DESTINATION ${{CURRENT_PACKAGES_DIR}}/include)
file(INSTALL ${{SOURCE_PATH}}/{lic} DESTINATION ${{CURRENT_PACKAGES_DIR}}/share/{prj} RENAME copyright)"""

tpl_vcpkg_note_sha =\
"""
Next actions:
- Obtain package SHA: 'vcpkg install {prj}', copy SHA mentioned in 'Actual hash: [...]'
- Add SHA to package: 'script\create-vcpkg --sha={sha}'
- Install package   : 'vcpkg install {prj}'"""

tpl_vcpkg_note_install =\
"""
Next actions:
- Install package: 'vcpkg install {prj}'"""

# End of vcpkg templates

def versionFrom( filename ):
    """Obtain version from conanfile.py"""<commit_msg>[skip ci] Allow side-by-side use with ms-gsl: only provide include/gsl/gsl-lite.hpp<commit_after>#!/usr/bin/env python
#
# Copyright 2019-2019 by <NAME>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# script/upload-conan.py, Python 3.4 and later
#

import argparse
import os
import re
import sys
import subprocess

# Configuration:

cfg_github_project = 'gsl-lite'
cfg_github_user    = 'martinmoene'

cfg_conanfile      = 'conanfile.py'
cfg_readme         = 'Readme.md'
cfg_license        = 'LICENSE'
cfg_ref_prefix     = 'v'

cfg_sha512            = 'dadeda'
cfg_vcpkg_description = '(no description found)'
cfg_vcpkg_root        = os.environ['VCPKG_ROOT']

# End configuration.

# vcpkg  control and port templates:

tpl_path_vcpkg_control  = '{vcpkg}/ports/{prj}/CONTROL'
tpl_path_vcpkg_portfile = '{vcpkg}/ports/{prj}/portfile.cmake'

tpl_vcpkg_control =\
"""Source: {prj}
Version: {ver}
Description: {desc}"""

tpl_vcpkg_portfile =\
"""include(vcpkg_common_functions)

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO {usr}/{prj}
    REF {ref}
    SHA512 {sha}
)

# To allow side-by-side use with ms-gsl, only provide include/gsl/gsl-lite.hpp:

file(INSTALL ${{SOURCE_PATH}}/include/gsl/gsl-lite.hpp DESTINATION ${{CURRENT_PACKAGES_DIR}}/include/gsl)
file(INSTALL ${{SOURCE_PATH}}/{lic} DESTINATION ${{CURRENT_PACKAGES_DIR}}/share/{prj} RENAME copyright)"""

tpl_vcpkg_note_sha =\
"""
Next actions:
- Obtain package SHA: 'vcpkg install {prj}', copy SHA mentioned in 'Actual hash: [...]'
- Add SHA to package: 'script\create-vcpkg --sha={sha}'
- Install package   : 'vcpkg install {prj}'"""

tpl_vcpkg_note_install =\
"""
Next actions:
- Install package: 'vcpkg install {prj}'"""

# End of vcpkg templates

def versionFrom( filename ):
    """Obtain version from conanfile.py"""
{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.011034482758620689, 'mean_word_length': 4.420029895366218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3062995', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1325, 'n_words': 301}