Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
Pylons/pyramid
AlexMarshall12/pyramid
AndreaCrotti/pyramid
Cito/pyramid
DeanHodgkinson/pyramid
DrunkenCub/pyramid
HorizonXP/pyramid
Hquant/pyramid
IDSGPlayground/pyramid-tutorial-yuxin-aaron
JDeuce/pyramid
Javex/pyramid
MorphiX00/pyramid
RichardBarrell/pyramid
RyoAbe/pyramid
SMFOSS/pyramid
XiaonuoGantan/pyramid
aMunRieL/pyramid
aadabi/pyramid
abourget/pyramid
adamryan/pyramid
adroullier/pyramid
alanliang/pyramid
alertedsnake/pyramid
altoplano/pyramid
alvinyue/pyramid
antoneliasson/pyramid
archanmishra/pyramid
asolomentsev/pyramid
audoe/pyramid
audreyr/pyramid
bbinet/pyramid
bdyaniv/pyramid
bennihepp/pyramid
bertjwregeer/pyramid
blaflamme/pyramid
brianr/pyramid
bshanks/pyramid
cameronr/pyramid
caseman/pyramid
cburns/pyramid
cconrad/pyramid
cdt3/pyramid
cguardia/pyramid
cherschel/pyramid
cjw296/pyramid
cloudappsetup/pyramid
countvajhula/pyramid
csenger/pyramid
daado/pyramid
dahabit/pyramid
dairiki/pyramid
david-furminieux/pyramid
davidjb/pyramid
dbaty/pyramid
dekimsey/pyramid
deshank/pyramid
dfee/pyramid
dhavlik/pyramid
di/pyramid
dianaclarke/pyramid
diarmuidbourke/pyramid
dnouri/pyramid
domenkozar/pyramid
douglatornell/pyramid
dzinxed/pyramid
einSelbst/pyramid
elpargo/pyramid
endophage/pyramid
ericrasmussen/pyramid
esehara/pyramid
eugeneai/pyramid
firemyst/pyramid
giorgil2/pyramid
gregglind/pyramid
gulp-swe/pyramid
gwho/pyramid
hathawsh/pyramid
helduel/pyramid
hfeeki/pyramid
hlv42/pyramid
ikeikeikeike/pyramid
irskep/pyramid
jackncoke/pyramid
jaewonk/pyramid
jarda/pyramid
jbohman/pyramid
jgonera/pyramid
jhnwsk/pyramid
jinty/pyramid
jkrebs/pyramid
johbo/pyramid
johnwshipman/pyramid
jpcw/pyramid
jtwaleson/pyramid
junkafarian/pyramid
kaiquewdev/pyramid
kenmanheimer/pyramid
khink/pyramid
knzm/pyramid
kroman0/pyramid
ksava/pyramid
ktosiu/pyramid
kusut/pyramid
lambacck/pyramid
lanestevens/pyramid
ledmonster/pyramid
leonsim/pyramid
lgiorgi/pyramid
lgp171188/pyramid
llacroix/pyramid
lxneng/pyramid
m4webb/pyramid
mabbas512/pyramid
madjar/pyramid
malthe/pyramid
marcofalcioni/pyramid
markramm/pyramid
mattburgess/pyramid
mbra/pyramid
mccane/pyramid
mgedmin/pyramid
michaelBenin/pyramid
mitchellrj/pyramid
mjpieters/pyramid
mkerrin/pyramid
mmerickel/pyramid
mojocatplay/pyramid
msabramo/pyramid
mt3/pyramid
muellert/pyramid
mypandos/pyramid
nek4life/pyramid
niallo/pyramid
nik-cars/pyramid
nmclean/pyramid
pbugni/pyramid
placidrage/pyramid
polinom/pyramid
ponomar/pyramid
ppaez/pyramid
pyeek/pyramid
pylonsproject-jp/pyramid
pyramidcn/pyramid
r0b1n1983/pyramid
rach/pyramid
ralphbean/pyramid
ranjithtenz/pyramid
ravikishore1993/pyramid
raviteja2007/pyramid
rbu/pyramid
reedobrien/pyramid
replaceafill/pyramid
rick446/pyramid
rjweir/pyramid
rob0t7/pyramid
ronjouch/pyramid
ronnix/pyramid
rpatterson/pyramid
samuelrayment/pyramid
sawdog/pyramid
sbellem/pyramid
shazow/pyramid
shentonfreude/pyramid
sjuxax/pyramid
skopp/pyramid
slacy/pyramid
slinkp/pyramid
slmf/pyramid
soulcheck/pyramid
spiffytech/pyramid
sptremblay/pyramid
szicari-cars/pyramid
t2y/pyramid
taiSon/pyramid
tamentis/pyramid
thegeekinside/pyramid
timo/pyramid
tml/pyramid
tomlikestorock/pyramid
velox-zz/pyramid
vhallac/pyramid
viirak/pyramid
vinces1979/pyramid
vipera/pyramid
virhilo/pyramid
wangmxf/pyramid
waynet/pyramid
westurner/pyramid
wichert/pyramid
witsch/pyramid
wrystr/pyramid
wujiang/pyramid
wwitzel3/pyramid
xaav/pyramid
yhc003/pyramid
zesk06/pyramid
zhenghao1/pyramid
ztane/pyramid
zuiwanting/pyramid
zwack/pyramid
Nothing to show
Choose a Head Repository
Pylons/pyramid
AlexMarshall12/pyramid
AndreaCrotti/pyramid
Cito/pyramid
DeanHodgkinson/pyramid
DrunkenCub/pyramid
HorizonXP/pyramid
Hquant/pyramid
IDSGPlayground/pyramid-tutorial-yuxin-aaron
JDeuce/pyramid
Javex/pyramid
MorphiX00/pyramid
RichardBarrell/pyramid
RyoAbe/pyramid
SMFOSS/pyramid
XiaonuoGantan/pyramid
aMunRieL/pyramid
aadabi/pyramid
abourget/pyramid
adamryan/pyramid
adroullier/pyramid
alanliang/pyramid
alertedsnake/pyramid
altoplano/pyramid
alvinyue/pyramid
antoneliasson/pyramid
archanmishra/pyramid
asolomentsev/pyramid
audoe/pyramid
audreyr/pyramid
bbinet/pyramid
bdyaniv/pyramid
bennihepp/pyramid
bertjwregeer/pyramid
blaflamme/pyramid
brianr/pyramid
bshanks/pyramid
cameronr/pyramid
caseman/pyramid
cburns/pyramid
cconrad/pyramid
cdt3/pyramid
cguardia/pyramid
cherschel/pyramid
cjw296/pyramid
cloudappsetup/pyramid
countvajhula/pyramid
csenger/pyramid
daado/pyramid
dahabit/pyramid
dairiki/pyramid
david-furminieux/pyramid
davidjb/pyramid
dbaty/pyramid
dekimsey/pyramid
deshank/pyramid
dfee/pyramid
dhavlik/pyramid
di/pyramid
dianaclarke/pyramid
diarmuidbourke/pyramid
dnouri/pyramid
domenkozar/pyramid
douglatornell/pyramid
dzinxed/pyramid
einSelbst/pyramid
elpargo/pyramid
endophage/pyramid
ericrasmussen/pyramid
esehara/pyramid
eugeneai/pyramid
firemyst/pyramid
giorgil2/pyramid
gregglind/pyramid
gulp-swe/pyramid
gwho/pyramid
hathawsh/pyramid
helduel/pyramid
hfeeki/pyramid
hlv42/pyramid
ikeikeikeike/pyramid
irskep/pyramid
jackncoke/pyramid
jaewonk/pyramid
jarda/pyramid
jbohman/pyramid
jgonera/pyramid
jhnwsk/pyramid
jinty/pyramid
jkrebs/pyramid
johbo/pyramid
johnwshipman/pyramid
jpcw/pyramid
jtwaleson/pyramid
junkafarian/pyramid
kaiquewdev/pyramid
kenmanheimer/pyramid
khink/pyramid
knzm/pyramid
kroman0/pyramid
ksava/pyramid
ktosiu/pyramid
kusut/pyramid
lambacck/pyramid
lanestevens/pyramid
ledmonster/pyramid
leonsim/pyramid
lgiorgi/pyramid
lgp171188/pyramid
llacroix/pyramid
lxneng/pyramid
m4webb/pyramid
mabbas512/pyramid
madjar/pyramid
malthe/pyramid
marcofalcioni/pyramid
markramm/pyramid
mattburgess/pyramid
mbra/pyramid
mccane/pyramid
mgedmin/pyramid
michaelBenin/pyramid
mitchellrj/pyramid
mjpieters/pyramid
mkerrin/pyramid
mmerickel/pyramid
mojocatplay/pyramid
msabramo/pyramid
mt3/pyramid
muellert/pyramid
mypandos/pyramid
nek4life/pyramid
niallo/pyramid
nik-cars/pyramid
nmclean/pyramid
pbugni/pyramid
placidrage/pyramid
polinom/pyramid
ponomar/pyramid
ppaez/pyramid
pyeek/pyramid
pylonsproject-jp/pyramid
pyramidcn/pyramid
r0b1n1983/pyramid
rach/pyramid
ralphbean/pyramid
ranjithtenz/pyramid
ravikishore1993/pyramid
raviteja2007/pyramid
rbu/pyramid
reedobrien/pyramid
replaceafill/pyramid
rick446/pyramid
rjweir/pyramid
rob0t7/pyramid
ronjouch/pyramid
ronnix/pyramid
rpatterson/pyramid
samuelrayment/pyramid
sawdog/pyramid
sbellem/pyramid
shazow/pyramid
shentonfreude/pyramid
sjuxax/pyramid
skopp/pyramid
slacy/pyramid
slinkp/pyramid
slmf/pyramid
soulcheck/pyramid
spiffytech/pyramid
sptremblay/pyramid
szicari-cars/pyramid
t2y/pyramid
taiSon/pyramid
tamentis/pyramid
thegeekinside/pyramid
timo/pyramid
tml/pyramid
tomlikestorock/pyramid
velox-zz/pyramid
vhallac/pyramid
viirak/pyramid
vinces1979/pyramid
vipera/pyramid
virhilo/pyramid
wangmxf/pyramid
waynet/pyramid
westurner/pyramid
wichert/pyramid
witsch/pyramid
wrystr/pyramid
wujiang/pyramid
wwitzel3/pyramid
xaav/pyramid
yhc003/pyramid
zesk06/pyramid
zhenghao1/pyramid
ztane/pyramid
zuiwanting/pyramid
zwack/pyramid
Nothing to show
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Oct 03, 2016
Add --package-name option to pcreate. This solves the problem
of scaffold creating an existing directory where the package
created should not be named after the base folder.
For example if I am in I run pcreate in ~/code/trypyramid.com and
would like to create package called tpc this is currently
impossible. This solves the issues by allowing me to specify
the package name on the command line
update pcreate --package-name help with better verbiage which
more explicitly states that package name is assumed to be safe
Merge pull request #2783 from goodwillcoding/pcreate_specify_project_…
…name

Add --package-name option to pcreate.
Showing with 36 additions and 3 deletions.
  1. +15 −3 pyramid/scripts/pcreate.py
  2. +21 −0 pyramid/tests/test_scripts/test_pcreate.py
View
@@ -45,6 +45,14 @@ class PCreateCommand(object):
action='store_true',
help=("A backwards compatibility alias for -l/--list. "
"List all available scaffold names."))
parser.add_option('--package-name',
dest='package_name',
action='store',
type='string',
help='Package name to use. Named provided is assumed to '
'be a valid python package name and will not be '
'validated. (By default package name is derived '
'from output_directory base folder name)')
parser.add_option('--simulate',
dest='simulate',
action='store_true',
@@ -99,9 +107,13 @@ def output_path(self):
def project_vars(self):
output_dir = self.output_path
project_name = os.path.basename(os.path.split(output_dir)[1])
pkg_name = _bad_chars_re.sub(
'', project_name.lower().replace('-', '_'))
safe_name = pkg_resources.safe_name(project_name)
if self.options.package_name is None:
pkg_name = _bad_chars_re.sub(
'', project_name.lower().replace('-', '_'))
safe_name = pkg_resources.safe_name(project_name)
else:
pkg_name = self.options.package_name
safe_name = pkg_name
egg_name = pkg_resources.to_filename(safe_name)
# get pyramid package version
@@ -80,6 +80,27 @@ def test_known_scaffold_single_rendered(self):
{'project': 'Distro', 'egg': 'Distro', 'package': 'distro',
'pyramid_version': '0.1', 'pyramid_docs_branch':'0.1-branch'})
def test_scaffold_with_package_name(self):
import os
cmd = self._makeOne('-s', 'dummy', '--package-name', 'dummy_package',
'Distro')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.1")
result = cmd.run()
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
os.path.normpath(os.path.join(os.getcwd(), 'Distro'))
)
self.assertEqual(
scaffold.vars,
{'project': 'Distro', 'egg': 'dummy_package',
'package': 'dummy_package', 'pyramid_version': '0.1',
'pyramid_docs_branch':'0.1-branch'})
def test_scaffold_with_hyphen_in_project_name(self):
import os
cmd = self._makeOne('-s', 'dummy', 'Distro-')

No commit comments for this range