• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pybuilder / pybuilder / 16613314016

30 Jul 2025 04:14AM UTC coverage: 84.008% (-0.1%) from 84.146%
16613314016

push

github

arcivanov
Release 0.13.16

2167 of 2671 branches covered (81.13%)

Branch coverage included in aggregate %.

5534 of 6496 relevant lines covered (85.19%)

36.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.61
/src/main/python/pybuilder/plugins/source_distribution_plugin.py
1
#   -*- coding: utf-8 -*-
2
#
3
#   This file is part of PyBuilder
4
#
5
#   Copyright 2011-2020 PyBuilder Team
6
#
7
#   Licensed under the Apache License, Version 2.0 (the "License");
8
#   you may not use this file except in compliance with the License.
9
#   You may obtain a copy of the License at
10
#
11
#       http://www.apache.org/licenses/LICENSE-2.0
12
#
13
#   Unless required by applicable law or agreed to in writing, software
14
#   distributed under the License is distributed on an "AS IS" BASIS,
15
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
#   See the License for the specific language governing permissions and
17
#   limitations under the License.
18

19
import os
22✔
20
import shutil
22✔
21

22
from pybuilder.core import init, task, use_plugin, description
22✔
23

24
use_plugin("core")
22✔
25

26

27
@init
22✔
28
def init_source_distribution(project):
22✔
29
    source_distribution_directory = "$dir_target/dist/%s-%s-src" % (project.name, project.version)
22✔
30
    project.set_property_if_unset("dir_source_dist", source_distribution_directory)
22✔
31
    project.set_property_if_unset("source_dist_ignore_patterns", ["*.pyc", ".hg*", ".svn", ".CVS"])
22✔
32

33

34
@task
22✔
35
@description("Bundles a source distribution for shipping.")
22✔
36
def build_source_distribution(project, logger):
22✔
37
    source_distribution_directory = project.expand_path("$dir_source_dist")
×
38
    logger.info("Building source distribution in {0}".format(source_distribution_directory))
×
39

40
    if os.path.exists(source_distribution_directory):
×
41
        shutil.rmtree(source_distribution_directory)
×
42

43
    ignore_patterns = ["target"]
×
44
    configured_patterns = project.get_property("source_dist_ignore_patterns")
×
45
    if configured_patterns:
×
46
        ignore_patterns += configured_patterns
×
47

48
    shutil.copytree(project.basedir,
×
49
                    source_distribution_directory,
50
                    ignore=shutil.ignore_patterns(*ignore_patterns))
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc