Commit e78e7c5c authored by Yuanle Song's avatar Yuanle Song
Browse files

prepare for upload v1.3.0.0 to pypi.

- update README.rst syntax check command. old check command is deprecated.
- pypi fetch pkg version from Cliversion.hs
parent 1445a8c9
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
* COMMENT -*- mode: org -*-
#+Date: 2018-05-04
Time-stamp: <2022-03-15>
Time-stamp: <2022-03-16>
#+STARTUP: content
* notes                                                               :entry:
** 2022-03-14 project dir structure
@@ -21,6 +21,11 @@ Time-stamp: <2022-03-15>
  README.md
  rd-api-README.rst
  rd-README.rst
- build wheel and test it in production server
  make dist -C pypi

  wheel will be built in pypi/rd-api/dist, pypi/rd-client/dist dir.

- release binary on PyPI
  export TWINE_PASSWORD=xxx
  make all -C pypi
@@ -29,6 +34,11 @@ Time-stamp: <2022-03-15>
  make api -C pypi
  make client -C pypi

- problems
  - how to sync build files for pypi?
    rsync -n -air --files-from=pypi/build_files ./ s02:projects/reliable-download/
    rsync -air --files-from=pypi/build_files ./ s02:projects/reliable-download/

** 2018-05-08 example run in prod env
- try it on de03

@@ -559,6 +569,10 @@ try use a smaller file within git tree.
    ./rd-api: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./rd-api)
  #+END_SRC

- problems
  - is readme_renderer still required? does twine require it?
    yes. it's required for "twine check" command.

** 2019-02-28 bug: rd-api -d java/
option -d: cannot parse value `java/'

+5 −1
Original line number Diff line number Diff line
all: api client
build: dist
dist:
	make -C rd-api dist
	make -C rd-client dist
api:
	make -C rd-api upload
client:
	make -C rd-client upload
.PHONY: all api client
.PHONY: all build api client

pypi/build_files

0 → 100644
+5 −0
Original line number Diff line number Diff line
pypi/Makefile
pypi/rd-api/Makefile
pypi/rd-api/setup.py
pypi/rd-client/Makefile
pypi/rd-client/setup.py
+2 −3
Original line number Diff line number Diff line
@@ -6,12 +6,11 @@ bootstrap:
	@if ! python3 -c 'import readme_renderer'; then python3 -m pip install --user readme_renderer ; fi
	@test -f ~/.local/bin/wheel || python3 -m pip install --user wheel
	@test -f ~/.local/bin/twine || python3 -m pip install --user twine
check: bootstrap
	python3 setup.py check -r -s
dist: check
dist: bootstrap
	cp -u `stack path --local-install-root`/bin/rd-api rdapi/
	rm -rf dist/*
	python3 setup.py -q bdist_wheel --universal
	~/.local/bin/twine check --strict dist/*
upload: dist
	~/.local/bin/twine upload dist/*
testupload: dist
+7 −6
Original line number Diff line number Diff line
@@ -7,16 +7,16 @@

from setuptools import setup, find_packages

def get_version_from_package_yaml():
    with open("../../package.yaml", "r") as f:
def get_version_from_CliVersion():
    with open("../../lib/RD/CliVersion.hs", "r") as f:
        for line in f:
            if line.startswith("version:"):
                return line.split(":")[1].strip()
    raise Exception("version not found in package.yaml")
            if line.startswith("cliVersion = "):
                return line.split('"')[1].strip()
    raise Exception("version not found in CliVersion.hs")

setup(
    name="rd-api",
    version=get_version_from_package_yaml(),
    version=get_version_from_CliVersion(),
    packages=find_packages(),
    package_data={
        'rdapi': ['rd-api']
@@ -33,6 +33,7 @@ setup(
    maintainer_email="sylecn@gmail.com",
    description="reliable-download server",
    long_description=open('README.rst').read(),
    long_description_content_type="text/x-rst",
    license="GPLv3+",
    url="https://pypi.python.org/pypi/rd-api/",
    classifiers=[
Loading